2020-12-09 22:43:49 +11:00
|
|
|
using System;
|
2020-06-02 21:35:19 +12:00
|
|
|
using System.ComponentModel;
|
2018-04-30 21:03:43 +02:00
|
|
|
using Newtonsoft.Json;
|
2017-12-07 13:22:32 +01:00
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource
|
2017-12-07 13:22:32 +01:00
|
|
|
{
|
2020-02-06 14:40:46 +01:00
|
|
|
public class PropertyData
|
2017-12-07 13:22:32 +01:00
|
|
|
{
|
2018-05-08 11:06:07 +02:00
|
|
|
private string _culture;
|
|
|
|
|
private string _segment;
|
|
|
|
|
|
2020-06-02 21:35:19 +12:00
|
|
|
[DefaultValue("")]
|
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, PropertyName = "c")]
|
2018-05-08 11:06:07 +02:00
|
|
|
public string Culture
|
|
|
|
|
{
|
|
|
|
|
get => _culture;
|
2019-01-27 01:17:32 -05:00
|
|
|
set => _culture = value ?? throw new ArgumentNullException(nameof(value)); // TODO: or fallback to string.Empty? CANNOT be null
|
2018-05-08 11:06:07 +02:00
|
|
|
}
|
2017-12-07 13:22:32 +01:00
|
|
|
|
2020-06-02 21:35:19 +12:00
|
|
|
[DefaultValue("")]
|
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, PropertyName = "s")]
|
2018-05-08 11:06:07 +02:00
|
|
|
public string Segment
|
|
|
|
|
{
|
|
|
|
|
get => _segment;
|
2019-01-27 01:17:32 -05:00
|
|
|
set => _segment = value ?? throw new ArgumentNullException(nameof(value)); // TODO: or fallback to string.Empty? CANNOT be null
|
2018-05-08 11:06:07 +02:00
|
|
|
}
|
2017-12-07 13:22:32 +01:00
|
|
|
|
2020-06-02 21:35:19 +12:00
|
|
|
[JsonProperty("v")]
|
2017-12-07 13:22:32 +01:00
|
|
|
public object Value { get; set; }
|
2020-06-02 21:35:19 +12:00
|
|
|
|
|
|
|
|
|
2020-12-09 22:43:49 +11:00
|
|
|
// Legacy properties used to deserialize existing nucache db entries
|
2020-06-02 21:35:19 +12:00
|
|
|
[JsonProperty("culture")]
|
|
|
|
|
private string LegacyCulture
|
|
|
|
|
{
|
|
|
|
|
set => Culture = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonProperty("seg")]
|
|
|
|
|
private string LegacySegment
|
|
|
|
|
{
|
|
|
|
|
set => Segment = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonProperty("val")]
|
|
|
|
|
private object LegacyValue
|
|
|
|
|
{
|
|
|
|
|
set => Value = value;
|
|
|
|
|
}
|
2017-12-07 13:22:32 +01:00
|
|
|
}
|
2018-04-21 09:57:28 +02:00
|
|
|
}
|