We are retrieving a block of cities and one of them has a null date in a field which generates an exception. How can I intercept the error but still get large blocks of records. We didn't want to retrieve the records 1 at a time as we have several thousand records to get.
Error converting value {null} to type 'System.DateTime'. Path 'result.records[0].datelec', line 1, position 4360. Newtonsoft.Json.JsonSerializationException
RootObject test = JsonConvert.DeserializeObject<RootObject>(fileMunicipalities);
municipalities.AddRange(test.result.Records);
urlService = URL_BASE +test.result._links.next;
}
while (!string.IsNullOrWhiteSpace(urlService));
string t = "";