#nullable disable
// THIS IS A HACK
// TODO: @bond Move to separate project
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace MediaBrowser.Model.Entities
{
///
/// Converts an object to a lowercase string.
///
/// The object type.
public class JsonLowerCaseConverter : JsonConverter
{
///
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return JsonSerializer.Deserialize(ref reader, options);
}
///
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
{
writer.WriteStringValue(value?.ToString().ToLowerInvariant());
}
}
}