I am creating C# application which gets the response from the web services and returns it as the List of DTO object like
List<Models.iLabDTO.RootObject> response = new List<Models.iLabDTO.RootObject>();
public async Task<IHttpActionResult> Get()
{
......
var request_returnDataObj = JsonConvert.DeserializeObject<Models.iLabDTO.RootObject>(responsefile);
response.Add(request_returnDataObj);
}
return Ok(response);
But it throws error like
<Error>
<Message>An error has occurred.</Message>
<ExceptionMessage>
Error converting value "on" to type 'System.Boolean'. Path
'il_response.c_forms[0].fields[0].required', line 1, position 354.
</ExceptionMessage>
<ExceptionType>Newtonsoft.Json.JsonSerializationException</ExceptionType>
If I have just return OK(response)
without using response.Add(request_returnDataObj)
it works fine. But I am unable return the list of objects