janssenr / SendCloudApi.Net

A C#/.net wrapper for the SendCloud API
MIT License
6 stars 5 forks source link

client.Integrations.Get() error #7

Closed davidkdb closed 3 years ago

davidkdb commented 3 years ago

After last fix there is a new issue:

System.Runtime.Serialization.SerializationException HResult=0x8013150C Message=There was an error deserializing the object of type SendCloudApi.Net.Models.Integration[]. String '2021-03-08T11:00:24.277796+01:00' was not recognized as a valid DateTime. Source=System.Private.DataContractSerialization StackTrace: at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.ReadObject(XmlDictionaryReader reader) at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.ReadObject(Stream stream) at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(Stream stream) at SendCloudApi.Net.Helpers.JsonHelper.Deserialize[T](String json, String dateTimeFormat) at SendCloudApi.Net.SendCloudApi.d251.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at SendCloudApi.Net.SendCloudApi.d221.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at SendCloudApi.Net.Resources.SendCloudApiAbstractResource.d141.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at SendCloudApi.Net.Resources.SendCloudApiIntegrationsResource.d1.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()

Inner Exception 1: FormatException: String '2021-03-08T11:00:24.277796+01:00' was not recognized as a valid DateTime.

I think the issue is that you use DateTime instead of DateTimeOffset everywhere

janssenr commented 3 years ago

This one should also be solved now.

davidkdb commented 3 years ago

Yes, it works