예제 #1
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("expression");
     writer.WriteStringValue(Expression);
     if (Optional.IsDefined(EndOn))
     {
         if (EndOn != null)
         {
             writer.WritePropertyName("endTime");
             writer.WriteStringValue(EndOn.Value, "O");
         }
         else
         {
             writer.WriteNull("endTime");
         }
     }
     if (Optional.IsDefined(ScheduleStatus))
     {
         writer.WritePropertyName("scheduleStatus");
         writer.WriteStringValue(ScheduleStatus.Value.ToString());
     }
     writer.WritePropertyName("scheduleType");
     writer.WriteStringValue(ScheduleType.ToString());
     if (Optional.IsDefined(StartOn))
     {
         if (StartOn != null)
         {
             writer.WritePropertyName("startTime");
             writer.WriteStringValue(StartOn.Value, "O");
         }
         else
         {
             writer.WriteNull("startTime");
         }
     }
     if (Optional.IsDefined(TimeZone))
     {
         if (TimeZone != null)
         {
             writer.WritePropertyName("timeZone");
             writer.WriteStringValue(TimeZone);
         }
         else
         {
             writer.WriteNull("timeZone");
         }
     }
     writer.WriteEndObject();
 }
예제 #2
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("frequency");
     writer.WriteStringValue(Frequency.ToString());
     writer.WritePropertyName("interval");
     writer.WriteNumberValue(Interval);
     if (Optional.IsDefined(Pattern))
     {
         if (Pattern != null)
         {
             writer.WritePropertyName("pattern");
             writer.WriteObjectValue(Pattern);
         }
         else
         {
             writer.WriteNull("pattern");
         }
     }
     if (Optional.IsDefined(EndOn))
     {
         if (EndOn != null)
         {
             writer.WritePropertyName("endTime");
             writer.WriteStringValue(EndOn.Value, "O");
         }
         else
         {
             writer.WriteNull("endTime");
         }
     }
     if (Optional.IsDefined(ScheduleStatus))
     {
         writer.WritePropertyName("scheduleStatus");
         writer.WriteStringValue(ScheduleStatus.Value.ToString());
     }
     writer.WritePropertyName("scheduleType");
     writer.WriteStringValue(ScheduleType.ToString());
     if (Optional.IsDefined(StartOn))
     {
         if (StartOn != null)
         {
             writer.WritePropertyName("startTime");
             writer.WriteStringValue(StartOn.Value, "O");
         }
         else
         {
             writer.WriteNull("startTime");
         }
     }
     if (Optional.IsDefined(TimeZone))
     {
         if (TimeZone != null)
         {
             writer.WritePropertyName("timeZone");
             writer.WriteStringValue(TimeZone);
         }
         else
         {
             writer.WriteNull("timeZone");
         }
     }
     writer.WriteEndObject();
 }