You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment: .NET 4.5 in VS2013
Requests captured using Fiddler
Possible (nasty?) fix: Make Company.CreatedAt a DateTime? instead of a DateTime (however see note at the end).
Issue: After updating a company using the code below, the final request to get a list of companies fails, if the updated company is in the block of companies requested
company.Tags.Add(newTag);
company.Tags.Add(oldTag);
api.CompanyRequest.Update(company);
api.CompanyRequest.Get(offset:(int?)currentBlock); // now this fails
Diagnosis:
RestSharp is actually the component throwing the exception. The company is updated with a value in the PUT of <created-at>30/05/2014 14:07:07</created-at> (for example), but is then returned in the GET xml with <created-at type="datetime" nil="true"></created-at>. The nil DateTime appears to then throw an exception within RestSharp:
Message: "String was not recognized as a valid DateTime."
Stacktrace: at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.DateTime.Parse(String s, IFormatProvider provider)
at RestSharp.Deserializers.XmlDeserializer.Map(Object x, XElement root)
at RestSharp.Deserializers.XmlDeserializer.CreateAndMap(Type t, XElement element)
at RestSharp.Deserializers.XmlDeserializer.PopulateListFromElements(Type t, IEnumerable`1 elements, IList list)
at RestSharp.Deserializers.XmlDeserializer.HandleListDerivative(Object x, XElement root, String propName, Type type)
at RestSharp.Deserializers.XmlDeserializer.Deserialize[T](IRestResponse response)
at RestSharp.RestClient.Deserialize[T](IRestRequest request, IRestResponse raw)
While changing Company.CreatedAt to public DateTime? CreatedAt { get; set; } allows all the companies to be returned in the block, that then creates a new issue: updating a company by api.CompanyRequest.Update(company) removes the value of CreatedAt.
The text was updated successfully, but these errors were encountered:
Environment: .NET 4.5 in VS2013
Requests captured using Fiddler
Possible (nasty?) fix: Make
Company.CreatedAt
aDateTime?
instead of aDateTime
(however see note at the end).Issue: After updating a company using the code below, the final request to get a list of companies fails, if the updated company is in the block of companies requested
Diagnosis:
RestSharp is actually the component throwing the exception. The company is updated with a value in the PUT of
<created-at>30/05/2014 14:07:07</created-at>
(for example), but is then returned in the GET xml with<created-at type="datetime" nil="true"></created-at>
. The nil DateTime appears to then throw an exception within RestSharp:While changing
Company.CreatedAt
topublic DateTime? CreatedAt { get; set; }
allows all the companies to be returned in the block, that then creates a new issue: updating a company byapi.CompanyRequest.Update(company)
removes the value ofCreatedAt
.The text was updated successfully, but these errors were encountered: