C
C#2mo 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
SWEETPONY2mo 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);