< Summary

Information
Class: System.Text.Json.Serialization.JsonStringEnumMemberNameAttribute
Assembly: System.Text.Json
File(s): C:\h\w\B31A098C\w\BB5A0A33\e\runtime-utils\Runner\runtime\src\libraries\System.Text.Json\src\System\Text\Json\Serialization\JsonStringEnumMemberNameAttribute.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 26
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)

C:\h\w\B31A098C\w\BB5A0A33\e\runtime-utils\Runner\runtime\src\libraries\System.Text.Json\src\System\Text\Json\Serialization\JsonStringEnumMemberNameAttribute.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    /// Determines the string value that should be used when serializing an enum member.
 8    /// </summary>
 9    [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
 10    public class JsonStringEnumMemberNameAttribute : Attribute
 11    {
 12        /// <summary>
 13        /// Creates new attribute instance with a specified enum member name.
 14        /// </summary>
 15        /// <param name="name">The name to apply to the current enum member.</param>
 016        public JsonStringEnumMemberNameAttribute(string name)
 017        {
 018            Name = name;
 019        }
 20
 21        /// <summary>
 22        /// Gets the name of the enum member.
 23        /// </summary>
 024        public string Name { get; }
 25    }
 26}

Methods/Properties

.ctor(System.String)
Name()