Пример #1
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(Domain))
     {
         writer.WritePropertyName("domain");
         writer.WriteStringValue(Domain.Value.ToString());
     }
     if (Optional.IsDefined(ModelVersion))
     {
         writer.WritePropertyName("model-version");
         writer.WriteStringValue(ModelVersion);
     }
     if (Optional.IsCollectionDefined(PiiCategories))
     {
         writer.WritePropertyName("pii-categories");
         writer.WriteStartArray();
         foreach (var item in PiiCategories)
         {
             writer.WriteStringValue(item.ToString());
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(StringIndexType))
     {
         writer.WritePropertyName("stringIndexType");
         writer.WriteStringValue(StringIndexType.ToString());
     }
     writer.WriteEndObject();
 }
Пример #2
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(ModelVersion))
     {
         writer.WritePropertyName("model-version");
         writer.WriteStringValue(ModelVersion);
     }
     if (Optional.IsDefined(StringIndexType))
     {
         writer.WritePropertyName("stringIndexType");
         writer.WriteStringValue(StringIndexType.ToString());
     }
     writer.WriteEndObject();
 }