abatishchev
abatishchev

Reputation: 100308

What is the name of term meaning next approach: A a = new A { Prop1 = a, Prop2 = b };

Could you please tip how to properly name object construction approach where public proprieties values are being set on object creation?

For example,

SqlCommand command = new SqlCommand { Connection = connection, CommandType = CommandType.Text };

Upvotes: 0

Views: 127

Answers (2)

Arcturus
Arcturus

Reputation: 27065

JPunyon is correct..

For further info see http://msdn.microsoft.com/en-us/library/bb384062.aspx

Upvotes: 1

I believe these are called Object Initializers...

Upvotes: 8

Related Questions