| File: System\Text\Json\Serialization\Attributes\JsonIgnoreAttribute.cs | Web Access |
| Project: src\runtime\src\libraries\System.Text.Json\src\System.Text.Json.csproj (System.Text.Json) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.Text.Json.Serialization { /// <summary> /// Prevents a property or field from being serialized or deserialized. /// When placed on a type, specifies the default <see cref="JsonIgnoreCondition"/> /// for all properties and fields of the type. /// </summary> [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public sealed class JsonIgnoreAttribute : JsonAttribute { /// <summary> /// Specifies the condition that must be met before a property or field will be ignored. /// </summary> /// <remarks>The default value is <see cref="JsonIgnoreCondition.Always"/>.</remarks> public JsonIgnoreCondition Condition { get; set; } = JsonIgnoreCondition.Always; /// <summary> /// Initializes a new instance of <see cref="JsonIgnoreAttribute"/>. /// </summary> public JsonIgnoreAttribute() { } } }