c# - How do I set properties in a class with a parameterless constructor on instantiation in one statement? -
i'm 103% sure possible , i've seen it, can't remember or syntax was.
i thought var obj = new thing({id=3, name="the thing"});
that's not working.
if i'm crazy, tell me so. don't think am...or maybe i'm crazy realize.
this should work
var obj = new thing{id=3, name="the thing"};
Comments
Post a Comment