[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false)]
public sealed class JsonPropertyNameAttribute : System.Text.Json.Serialization.JsonAttribute
{
- public JsonPropertyNameAttribute(string propertyName) { }
- public string Name { get; set; }
+ public JsonPropertyNameAttribute(string name) { }
+ public string Name { get; }
}
public abstract partial class JsonNamingPolicy
[System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false)]
public sealed partial class JsonPropertyNameAttribute : System.Text.Json.Serialization.JsonAttribute
{
- public JsonPropertyNameAttribute(string propertyName) { }
- public string Name { get { throw null; } set { } }
+ public JsonPropertyNameAttribute(string name) { }
+ public string Name { get { throw null; } }
}
public static partial class JsonSerializer
{
/// <summary>
/// Initializes a new instance of <see cref="JsonPropertyNameAttribute"/> with the specified property name.
/// </summary>
- /// <param name="propertyName">The name of the property.</param>
- public JsonPropertyNameAttribute(string propertyName)
+ /// <param name="name">The name of the property.</param>
+ public JsonPropertyNameAttribute(string name)
{
- Name = propertyName;
+ Name = name;
}
/// <summary>
/// The name of the property.
/// </summary>
- public string Name { get; set; }
+ public string Name { get; }
}
}