diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-06-19 18:02:33 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-06-19 18:04:46 +0200 |
| commit | 6f8ccab788e85e025eaa44b67a1487bf419afb53 (patch) | |
| tree | f8895fae8ec17e922daab473180c9de9a702a02a /MediaBrowser.Common/Json/Converters/JsonNullableStructConverterFactory.cs | |
| parent | 0c3dcdf77b0d124517bffa608bfddf7d8f7682db (diff) | |
Move non-jellyfin extensions to separate project
Diffstat (limited to 'MediaBrowser.Common/Json/Converters/JsonNullableStructConverterFactory.cs')
| -rw-r--r-- | MediaBrowser.Common/Json/Converters/JsonNullableStructConverterFactory.cs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/MediaBrowser.Common/Json/Converters/JsonNullableStructConverterFactory.cs b/MediaBrowser.Common/Json/Converters/JsonNullableStructConverterFactory.cs deleted file mode 100644 index e2a3d798a..000000000 --- a/MediaBrowser.Common/Json/Converters/JsonNullableStructConverterFactory.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace MediaBrowser.Common.Json.Converters -{ - /// <summary> - /// Json nullable struct converter factory. - /// </summary> - public class JsonNullableStructConverterFactory : JsonConverterFactory - { - /// <inheritdoc /> - public override bool CanConvert(Type typeToConvert) - { - return typeToConvert.IsGenericType - && typeToConvert.GetGenericTypeDefinition() == typeof(Nullable<>) - && typeToConvert.GenericTypeArguments[0].IsValueType; - } - - /// <inheritdoc /> - public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) - { - var structType = typeToConvert.GenericTypeArguments[0]; - return (JsonConverter?)Activator.CreateInstance(typeof(JsonNullableStructConverter<>).MakeGenericType(structType)); - } - } -} |
