microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.Common/Json/TrueTypeJsonConverter.cs
24lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using System.Text.Json; |
| 5 | using System.Text.Json.Serialization; |
| 6 | |
| 7 | namespace Microsoft.Teams.Common.Json; |
| 8 | |
| 9 | /// <summary> |
| 10 | /// JsonConverter that writes using the |
| 11 | /// values concrete type |
| 12 | /// </summary> |
| 13 | public class TrueTypeJsonConverter<T> : JsonConverter<T> where T : notnull |
| 14 | { |
| 15 | public override T? Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options) |
| 16 | { |
| 17 | throw new NotImplementedException(); |
| 18 | } |
| 19 | |
| 20 | public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options) |
| 21 | { |
| 22 | JsonSerializer.Serialize(writer, value, value.GetType(), options); |
| 23 | } |
| 24 | } |