C
C#9mo ago
SWEETPONY

✅ how to convert Dictionary to C# object?

I have Dictionary<string, object> map string is property name and object is property value is it possible to deserialize this to real object?
1 Reply
SWEETPONY
SWEETPONYOP9mo ago
I can do this but only with newtonsoft:
var str = JsonConvert.SerializeObject(changes);
var obj = JsonConvert.DeserializeObject<WorkingTaskModel>(str);
var str = JsonConvert.SerializeObject(changes);
var obj = JsonConvert.DeserializeObject<WorkingTaskModel>(str);

Did you find this page helpful?