2021-06-24 09:43:57 -06:00
|
|
|
using System.Runtime.Serialization;
|
2024-02-14 12:10:45 +01:00
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
using Umbraco.Cms.Infrastructure.Serialization;
|
2018-04-24 01:31:01 +10:00
|
|
|
|
2022-06-20 09:21:08 +02:00
|
|
|
namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents the culture variation information on a content item
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataContract] // NOTE: Use DataContract annotations here to control how MessagePack serializes/deserializes the data to use INT keys
|
|
|
|
|
public class CultureVariation
|
2018-04-24 01:31:01 +10:00
|
|
|
{
|
2022-06-20 09:21:08 +02:00
|
|
|
[DataMember(Order = 0)]
|
2024-02-14 12:10:45 +01:00
|
|
|
[JsonPropertyName("nm")]
|
2022-06-20 09:21:08 +02:00
|
|
|
public string? Name { get; set; }
|
|
|
|
|
|
|
|
|
|
[DataMember(Order = 1)]
|
2024-02-14 12:10:45 +01:00
|
|
|
[JsonPropertyName("us")]
|
2022-06-20 09:21:08 +02:00
|
|
|
public string? UrlSegment { get; set; }
|
|
|
|
|
|
|
|
|
|
[DataMember(Order = 2)]
|
2024-02-14 12:10:45 +01:00
|
|
|
[JsonPropertyName("dt")]
|
2024-04-10 20:21:24 +02:00
|
|
|
[JsonConverter(typeof(JsonUniversalDateTimeConverter))]
|
2022-06-20 09:21:08 +02:00
|
|
|
public DateTime Date { get; set; }
|
|
|
|
|
|
|
|
|
|
[DataMember(Order = 3)]
|
2024-02-14 12:10:45 +01:00
|
|
|
[JsonPropertyName("isd")]
|
2022-06-20 09:21:08 +02:00
|
|
|
public bool IsDraft { get; set; }
|
|
|
|
|
|
|
|
|
|
// Legacy properties used to deserialize existing nucache db entries
|
|
|
|
|
[IgnoreDataMember]
|
2024-02-14 12:10:45 +01:00
|
|
|
[JsonPropertyName("nam")]
|
2022-06-20 09:21:08 +02:00
|
|
|
private string LegacyName { set => Name = value; }
|
|
|
|
|
|
|
|
|
|
[IgnoreDataMember]
|
2024-02-14 12:10:45 +01:00
|
|
|
[JsonPropertyName("urlSegment")]
|
2022-06-20 09:21:08 +02:00
|
|
|
private string LegacyUrlSegment { set => UrlSegment = value; }
|
|
|
|
|
|
|
|
|
|
[IgnoreDataMember]
|
2024-02-14 12:10:45 +01:00
|
|
|
[JsonPropertyName("date")]
|
2024-04-10 20:21:24 +02:00
|
|
|
[JsonConverter(typeof(JsonUniversalDateTimeConverter))]
|
2022-06-20 09:21:08 +02:00
|
|
|
private DateTime LegacyDate { set => Date = value; }
|
|
|
|
|
|
|
|
|
|
[IgnoreDataMember]
|
2024-02-14 12:10:45 +01:00
|
|
|
[JsonPropertyName("isDraft")]
|
2022-06-20 09:21:08 +02:00
|
|
|
private bool LegacyIsDraft { set => IsDraft = value; }
|
2018-04-24 01:31:01 +10:00
|
|
|
}
|