When indexing a document with DateTimeOffset field exception is thrown:
System.InvalidCastException
Unable to cast object of type 'System.DateTimeOffset' to type 'System.DateTime'.
at Cheetah.WebApi.Shared.Util.UtcDateTimeConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
When indexing a document with unassigned DateTime field exception is thrown:
System.ArgumentOutOfRangeException
The UTC time represented when the offset is applied must be between year 0 and 10,000. (Parameter 'offset')
at System.DateTimeOffset.ValidateDate(DateTime dateTime, TimeSpan offset)
at System.DateTimeOffset..ctor(DateTime dateTime)
at Cheetah.WebApi.Shared.Util.UtcDateTimeConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
Tell us about the problem
When indexing a document with DateTimeOffset field exception is thrown: System.InvalidCastException Unable to cast object of type 'System.DateTimeOffset' to type 'System.DateTime'. at Cheetah.WebApi.Shared.Util.UtcDateTimeConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
When indexing a document with unassigned DateTime field exception is thrown: System.ArgumentOutOfRangeException The UTC time represented when the offset is applied must be between year 0 and 10,000. (Parameter 'offset') at System.DateTimeOffset.ValidateDate(DateTime dateTime, TimeSpan offset) at System.DateTimeOffset..ctor(DateTime dateTime) at Cheetah.WebApi.Shared.Util.UtcDateTimeConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
Stacktrace
No response