Named Arguments versus Object Initializers

Posted by K. Scott Allen (OdeToCode.com) on July 7, 2010

The object initializer syntax introduced in C# makes it easy to work with "configuration" type objects. public class TemperatureSetting
{
public float Value { get; set; }
public float Variance { get; set; }
public float Threshold { get; set; }
}
// ...

var settings = new TemperatureSetting
... [read more]

Rating

not rated

Reviews

There are currently no comments or reviews.

Submit a review:

Login required.