KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
so the followwing works just fine, giving me a Team object from the string json: var found = JsonConvert.DeserializeObject<Team>(json); but what if I won't know the type until runtime? Say I've got the string json as above, but I also have another string with the type name? for example, this isn't working: var found = JsonConvert.DeserializeObject(json, Type.GetType("Team")); Unable to cast object of type 'Newtonsoft.Json.Linq.JArray' to type ...
Tags (comma-separated)
Save Edits
Cancel