sdk/dotnet/src/Microsoft.AspNetCore.Datasync/Converters/DateTimeOffsetJsonConverter.cs
/// <summary>
/// Write the provided value to JSON format.
/// </summary>
Write the provided value to JSON format.
Write the provided value to JSON format .
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            if (value is DateTimeOffset output)
            {
                writer.WriteValue(output.ToUniversalTime().ToString(format));
            }
            else
            {
                throw new JsonSerializationException($"Value of type {value.GetType().Name} is not supported here");
            }
        }
public override void WriteJson ( JsonWriter writer , object value , JsonSerializer serializer ) { if ( value is DateTimeOffset output ) { writer . WriteValue ( output . ToUniversalTime ( ) . ToString ( format ) ) ; } else { throw new JsonSerializationException ( $" Value of type  { value . GetType ( ) . Name }  is not supported here " ) ; } }
Write the provided value to JSON format.
Write the provided value to JSON format .
writer
JsonWriter
value
object
serializer
JsonSerializer