Ejemplo n.º 1
0
        internal void WriteToJson(System.Text.Json.Utf8JsonWriter writer)
        {
            writer.WritePropertyName(nameof(PartitionKeys));
            writer.WriteStartArray();
            if (PartitionKeys != null)
            {
                for (int i = 0; i < PartitionKeys.Length; i++)
                {
                    writer.WriteNumberValue(PartitionKeys[i]);
                }
            }
            writer.WriteEndArray();

            writer.WritePropertyName(nameof(ClusteringColumns));
            if (ClusteringColumns != null && ClusteringColumns.Length > 0)
            {
                writer.WriteStartArray();
                for (int i = 0; i < ClusteringColumns.Length; i++)
                {
                    writer.WriteStartObject();
                    writer.WriteNumber("MemberId", ClusteringColumns[i].MemberId);
                    writer.WriteBoolean("OrderByDesc", ClusteringColumns[i].OrderByDesc);
                    writer.WriteEndObject();
                }
                writer.WriteEndArray();
            }
            else
            {
                writer.WriteEmptyArray();
            }
        }
Ejemplo n.º 2
0
 public override void Write(System.Text.Json.Utf8JsonWriter writer, LongId value, System.Text.Json.JsonSerializerOptions options)
 {
     writer.WriteNumberValue(value.Value);
 }