Create arrays of anonymous types - CSharp Custom Type

CSharp examples for Custom Type:Anonymous Types

Description

Create arrays of anonymous types

Demo Code

using System;/*w w  w .  j a  v a2s  .co  m*/
class Test
{
    static void Main()
    {

        var dudes = new[]
        {
       new { Name = "Bob", Age = 30 },
       new { Name = "Tom", Age = 40 }
     };

        Console.WriteLine(dudes);
    }
}

Result


Related Tutorials