i just stumbled upon a use case where i want to fill a anonymous object with values coming from json:
var o = new { foo = "123", bar = "456" };
JsonConvert.PopulateObject(@"{'foo': 'abc'}", o);
Console.WriteLine(o.foo); // outputs "123" instead of "abc"
but it does not work as long as o is of anonymous type.
Anonymous objects don't have setters.
i see, didn't know too much about anonymous types. there would be a way by modifying their backing fields but i guess you wouldn't want that it in the lib.
in any case, here's my workaround: https://dotnetfiddle.net/S4GPil
Most helpful comment
in any case, here's my workaround: https://dotnetfiddle.net/S4GPil