4 ms·
That "Init-only properties" feature is huge. I spend so long at work when working on tests making stubs of objects with private setters etc (e.g. DTOs). That w
by benbristow 6y ago
That "Init-only properties" feature is huge.
I spend so long at work when working on tests making stubs of objects with private setters etc (e.g. DTOs). That work is essentially gone now, awesome!
- 0xcoffee 6y agoIt also drove me mad with JSON deserialization. Hopefully this will work nicely with newtonsoft.
- jrimbault 6y agoI think they said it was only a compiler error, it's still a normal setter underneath, so newtonsoft would not see any difference.
- benbristow 6y agoNewtonsoft (and the new Microsoft .NET framework JSON (de)serializer) only uses the setters once too to set the properties after processing the JSON, I can't see it causing an issue.
- iscg 6y agoAre you me? That's exactly the same reason why this feature has me so excited. Will save me so much time when testing.