Ejemplo n.º 1
0
 public override void Write(System.Text.Json.Utf8JsonWriter writer, Maybe <T> value, System.Text.Json.JsonSerializerOptions options)
 {
     if (value.HasValue)
     {
         System.Text.Json.JsonSerializer.Serialize(writer, value.Value, options);
     }
     else
     {
         writer.WriteNullValue();
     }
 }
Ejemplo n.º 2
0
 public override void Write(System.Text.Json.Utf8JsonWriter Utf8JsonWriter, System.Text.Json.JsonElement JsonElement, System.Text.Json.JsonSerializerOptions JsonSerializerOptions)
 {
     if (JsonElement.ValueKind != System.Text.Json.JsonValueKind.Undefined)
     {
         JsonElement.WriteTo(Utf8JsonWriter);
     }
     else
     {
         Utf8JsonWriter.WriteNullValue();
     }
 }