Files
Umbraco-CMS/src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentNestedData.cs

37 lines
1.5 KiB
C#
Raw Normal View History

using Newtonsoft.Json;
using System.Collections.Generic;
using Umbraco.Core.Serialization;
namespace Umbraco.Web.PublishedCache.NuCache.DataSource
{
/// <summary>
/// The content item 1:M data that is serialized to JSON
/// </summary>
public class ContentNestedData
{
//dont serialize empty properties
[JsonProperty("pd")]
[JsonConverter(typeof(AutoInterningStringKeyCaseInsensitiveDictionaryConverter<PropertyData[]>))]
public Dictionary<string, PropertyData[]> PropertyData { get; set; }
[JsonProperty("cd")]
[JsonConverter(typeof(AutoInterningStringKeyCaseInsensitiveDictionaryConverter<CultureVariation>))]
public Dictionary<string, CultureVariation> CultureData { get; set; }
2019-03-05 11:15:30 +01:00
[JsonProperty("us")]
2019-03-05 11:15:30 +01:00
public string UrlSegment { get; set; }
//Legacy properties used to deserialize existing nucache db entries
[JsonProperty("properties")]
[JsonConverter(typeof(CaseInsensitiveDictionaryConverter<PropertyData[]>))]
private Dictionary<string, PropertyData[]> LegacyPropertyData { set { PropertyData = value; } }
[JsonProperty("cultureData")]
[JsonConverter(typeof(CaseInsensitiveDictionaryConverter<CultureVariation>))]
private Dictionary<string, CultureVariation> LegacyCultureData { set { CultureData = value; } }
[JsonProperty("urlSegment")]
private string LegacyUrlSegment { set { UrlSegment = value; } }
}
}