| | | 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 | | |
| | | 4 | | namespace System.Text.Json.Serialization |
| | | 5 | | { |
| | | 6 | | /// <summary> |
| | | 7 | | /// When placed on a type, determines the <see cref="JsonUnmappedMemberHandling"/> configuration |
| | | 8 | | /// for the specific type, overriding the global <see cref="JsonSerializerOptions.UnmappedMemberHandling"/> setting. |
| | | 9 | | /// </summary> |
| | | 10 | | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct, |
| | | 11 | | AllowMultiple = false, Inherited = false)] |
| | | 12 | | public class JsonUnmappedMemberHandlingAttribute : JsonAttribute |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// Initializes a new instance of <see cref="JsonUnmappedMemberHandlingAttribute"/>. |
| | | 16 | | /// </summary> |
| | | 17 | | /// <param name="unmappedMemberHandling">The handling to apply to the current member.</param> |
| | 0 | 18 | | public JsonUnmappedMemberHandlingAttribute(JsonUnmappedMemberHandling unmappedMemberHandling) |
| | 0 | 19 | | { |
| | 0 | 20 | | UnmappedMemberHandling = unmappedMemberHandling; |
| | 0 | 21 | | } |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// Specifies the unmapped member handling setting for the attribute. |
| | | 25 | | /// </summary> |
| | 0 | 26 | | public JsonUnmappedMemberHandling UnmappedMemberHandling { get; } |
| | | 27 | | } |
| | | 28 | | } |