Files
Umbraco-CMS/src/Umbraco.PublishedCache.HybridCache/ContentData.cs
Nikolaj Geisle 1c859e75ca V15: Add custom serializer for hybrid cache (#17727)
* Add custom serializer

* Add migration to rebuild cache

* Rename migration namespace to 15.1

* Also clear media cache

* Remove failed cache items

* Refactor to only use keys for document cache repository

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2024-12-06 13:20:57 +01:00

46 lines
1.5 KiB
C#

using System.ComponentModel;
namespace Umbraco.Cms.Infrastructure.HybridCache;
/// <summary>
/// Represents everything that is specific to an edited or published content version
/// </summary>
// This is for cache performance reasons, see https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid?view=aspnetcore-9.0#reuse-objects
[ImmutableObject(true)]
public sealed class ContentData
{
public ContentData(string? name, string? urlSegment, int versionId, DateTime versionDate, int writerId, int? templateId, bool published, Dictionary<string, PropertyData[]>? properties, IReadOnlyDictionary<string, CultureVariation>? cultureInfos)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
UrlSegment = urlSegment;
VersionId = versionId;
VersionDate = versionDate;
WriterId = writerId;
TemplateId = templateId;
Published = published;
Properties = properties ?? throw new ArgumentNullException(nameof(properties));
CultureInfos = cultureInfos;
}
public string Name { get; }
public string? UrlSegment { get; }
public int VersionId { get; }
public DateTime VersionDate { get; }
public int WriterId { get; }
public int? TemplateId { get; }
public bool Published { get; }
public Dictionary<string, PropertyData[]> Properties { get; }
/// <summary>
/// The collection of language Id to name for the content item
/// </summary>
public IReadOnlyDictionary<string, CultureVariation>? CultureInfos { get; }
}