V10: fix build warnings nucache (#12500)
* Run code cleanup * Finish dotnet format and manual cleanup * Fix according to review Co-authored-by: Zeegaan <nge@umbraco.dk>
This commit is contained in:
@@ -1,62 +1,63 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Cms.Infrastructure.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource
|
||||
namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource;
|
||||
|
||||
[DataContract] // NOTE: Use DataContract annotations here to control how MessagePack serializes/deserializes the data to use INT keys
|
||||
public class PropertyData
|
||||
{
|
||||
private string? _culture;
|
||||
private string? _segment;
|
||||
|
||||
[DataContract] // NOTE: Use DataContract annotations here to control how MessagePack serializes/deserializes the data to use INT keys
|
||||
public class PropertyData
|
||||
[DataMember(Order = 0)]
|
||||
[JsonConverter(typeof(AutoInterningStringConverter))]
|
||||
[DefaultValue("")]
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, PropertyName = "c")]
|
||||
public string? Culture
|
||||
{
|
||||
private string? _culture;
|
||||
private string? _segment;
|
||||
get => _culture;
|
||||
set => _culture =
|
||||
value ?? throw new ArgumentNullException(
|
||||
nameof(value)); // TODO: or fallback to string.Empty? CANNOT be null
|
||||
}
|
||||
|
||||
[DataMember(Order = 0)]
|
||||
[JsonConverter(typeof(AutoInterningStringConverter))]
|
||||
[DefaultValue("")]
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, PropertyName = "c")]
|
||||
public string? Culture
|
||||
{
|
||||
get => _culture;
|
||||
set => _culture = value ?? throw new ArgumentNullException(nameof(value)); // TODO: or fallback to string.Empty? CANNOT be null
|
||||
}
|
||||
[DataMember(Order = 1)]
|
||||
[JsonConverter(typeof(AutoInterningStringConverter))]
|
||||
[DefaultValue("")]
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, PropertyName = "s")]
|
||||
public string? Segment
|
||||
{
|
||||
get => _segment;
|
||||
set => _segment =
|
||||
value ?? throw new ArgumentNullException(
|
||||
nameof(value)); // TODO: or fallback to string.Empty? CANNOT be null
|
||||
}
|
||||
|
||||
[DataMember(Order = 1)]
|
||||
[JsonConverter(typeof(AutoInterningStringConverter))]
|
||||
[DefaultValue("")]
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, PropertyName = "s")]
|
||||
public string? Segment
|
||||
{
|
||||
get => _segment;
|
||||
set => _segment = value ?? throw new ArgumentNullException(nameof(value)); // TODO: or fallback to string.Empty? CANNOT be null
|
||||
}
|
||||
[DataMember(Order = 2)]
|
||||
[JsonProperty("v")]
|
||||
public object? Value { get; set; }
|
||||
|
||||
[DataMember(Order = 2)]
|
||||
[JsonProperty("v")]
|
||||
public object? Value { get; set; }
|
||||
// Legacy properties used to deserialize existing nucache db entries
|
||||
[IgnoreDataMember]
|
||||
[JsonProperty("culture")]
|
||||
private string LegacyCulture
|
||||
{
|
||||
set => Culture = value;
|
||||
}
|
||||
|
||||
// Legacy properties used to deserialize existing nucache db entries
|
||||
[IgnoreDataMember]
|
||||
[JsonProperty("culture")]
|
||||
private string LegacyCulture
|
||||
{
|
||||
set => Culture = value;
|
||||
}
|
||||
[IgnoreDataMember]
|
||||
[JsonProperty("seg")]
|
||||
private string LegacySegment
|
||||
{
|
||||
set => Segment = value;
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
[JsonProperty("seg")]
|
||||
private string LegacySegment
|
||||
{
|
||||
set => Segment = value;
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
[JsonProperty("val")]
|
||||
private object LegacyValue
|
||||
{
|
||||
set => Value = value;
|
||||
}
|
||||
[IgnoreDataMember]
|
||||
[JsonProperty("val")]
|
||||
private object LegacyValue
|
||||
{
|
||||
set => Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user