using System.ComponentModel;
namespace Umbraco.Cms.Infrastructure.HybridCache;
///
/// Represents everything that is specific to an edited or published content version
///
// 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? properties, IReadOnlyDictionary? 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 Properties { get; }
///
/// The collection of language Id to name for the content item
///
public IReadOnlyDictionary? CultureInfos { get; }
}