I am trying to return a JSON object from a Web API call. I would like to return this object in terms of the interface it implements, so:
response.Content.ReadAsAsync<IThingy>().Result
I'm getting this error:
Could not create an instance of type IThingy. Type is an interface or abstract class and cannot be instantiated.
Really this is just the same as the problem in this question, except that I want to deserialize an object that implements an interface, rather than deserializing a property whose type implements an interface.
How can I do this deserialization?