public static DateTimeSpecification Parse(string json) { var serializer = new JsonSerializer() { DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore }; using (var reader = new JsonTextReader(new StringReader(json))) { DateTimeSpecification spec = serializer.Deserialize <DateTimeSpecification>(reader); return(spec); } }
public DateTimeRange(DateTimeSpecification singleUnit) { Start = singleUnit; singleUnit.Boundary = DateTimeSpecificationBounds.Lower; End = singleUnit; singleUnit.Boundary = DateTimeSpecificationBounds.Upper; }