WITH in C Sharp

From Logic Wiki
Revision as of 14:07, 4 September 2014 by Macrop (Talk) (Macrop moved page With in C to WITH in C Sharp without leaving a redirect: misspelled)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Although C# doesn't have any direct equivalent for the general case, C# 3 gain object initializer syntax for constructor calls:

var foo = new Foo { Property1 = value1, Property2 = value2, etc };