I'm trying to do is deserialize json into an object in c#. What I want to be able to do is pass any object get it's type and deserialize the json into that particular object using the JSON.Net library. Here are the lines of code.
Object someObject1 = someObject;
string result = await content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<someObject1.GetType()>(result);
The last line throws an exception of
operator '<' cannot be applied to operands of type 'method group'
How do I get the data type in the <> without c# complaining. What do I have to do to make this code work? And what knowledge am I missing?