.Net Goodies
Code snippets and technology news that come across my daily life.
Saturday, January 10, 2009
New in C# 3.0 - Object Initializers
In normal scenario we used to create and initialize object as
Sample sample = new Sample();
sample.Value = "value";
sample.Text = "text";
In C# 3.0 the same can be achieved as
Sample sample = new Sample()
{ Value="value", Text="text" };
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment