< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 28
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonPropertyNameAttribute.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4namespace System.Text.Json.Serialization
 5{
 6    /// <summary>
 7    /// Specifies the property name that is present in the JSON when serializing and deserializing.
 8    /// This overrides any naming policy specified by <see cref="JsonNamingPolicy"/>.
 9    /// </summary>
 10    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
 11    public sealed class JsonPropertyNameAttribute : JsonAttribute
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of <see cref="JsonPropertyNameAttribute"/> with the specified property name.
 15        /// </summary>
 16        /// <param name="name">The name of the property.</param>
 017        public JsonPropertyNameAttribute(string name)
 018        {
 019            Name = name;
 020        }
 21
 22        /// <summary>
 23        /// The name of the property.
 24        /// </summary>
 025        public string Name { get; }
 26    }
 27}
 28

Methods/Properties

.ctor(System.String)
Name()