C# 3.0 Object Initializers

Dec 16, 2007 17:37

В .NET 3.5 код:

class Oini
{
   public static void Main()
   {
      Customer c = new Customer() { Name = "Bart", City = "Redmond", Age = 24 };
   }
}

не аналогичен следующему:

class Oini
{
   public static void Main()
   {
      Customer c = new Customer();
      c.Name = " ( Read more... )

Leave a comment

Comments 1

(The comment has been removed)

russiangeek January 3 2008, 12:53:09 UTC
Вот тут есть источник с объяснением: смотреть.

Reply


Leave a comment

Up