/// <summary>
        /// Serializes the provided <see cref="Interval"/>.
        /// </summary>
        /// <param name="value">The <see cref="Interval"/> to to serialize.</param>
        /// <returns>The serialized representation.</returns>
        public string Serialize(Interval value)
        {
            var complexIntervalDto = new ComplexRawIntervalDto
            {
                Start = _instantSerializer.Serialize(value.Start),
                End   = _instantSerializer.Serialize(value.End)
            };

            return(JsonSerializer.SerializeToString(complexIntervalDto));
        }
 private static bool IsValid(ComplexRawIntervalDto complexIntervalDto)
 {
     if (complexIntervalDto == null)
     {
         return(false);
     }
     if (string.IsNullOrEmpty(complexIntervalDto.Start))
     {
         return(false);
     }
     return(!string.IsNullOrEmpty(complexIntervalDto.End));
 }