< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
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)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonIgnoreAttribute.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    /// Prevents a property or field from being serialized or deserialized.
 8    /// When placed on a type, specifies the default <see cref="JsonIgnoreCondition"/>
 9    /// for all properties and fields of the type.
 10    /// </summary>
 11    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Pro
 12    public sealed class JsonIgnoreAttribute : JsonAttribute
 13    {
 14        /// <summary>
 15        /// Specifies the condition that must be met before a property or field will be ignored.
 16        /// </summary>
 17        /// <remarks>The default value is <see cref="JsonIgnoreCondition.Always"/>.</remarks>
 018        public JsonIgnoreCondition Condition { get; set; } = JsonIgnoreCondition.Always;
 19
 20        /// <summary>
 21        /// Initializes a new instance of <see cref="JsonIgnoreAttribute"/>.
 22        /// </summary>
 023        public JsonIgnoreAttribute() { }
 24    }
 25}
 26

Methods/Properties

Condition()
.ctor()