I am trying to make deserialize json into an object in C #. What I want to do is pass its type to any object and deserialize json into that specific 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);
Exception thrown on last line
operator '<' cannot be applied to operands of type 'method group'
How to get data type in <> without C # complaint. What do I need to do to make this code work? And what knowledge do I lack?
raging_subs Sep 04 '14 at 18:12 2014-09-04 18:12
source share