I want to deserialize json string to list of objects which type I get at runtime.
For example:
my json string is [{"id":"1", "name":"test"},{"id":"2", "name":"test2"}] and the type I get is "Types.type1, types.dll", so I need to deserialize it to List<type1>. If I will get the type "Types.type2, types.dll" so I need to deserialize it to List<type2>
How I can do this?
You may use
DataContractJsonSerializerinSystem.Runtime.SerializationTo solve the problem of having it in runtime, use below: