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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -