Creating an Anonymous type in c#

Madhu.b.rokkam
Posted by Madhu.b.rokkam under C# category on | Points: 40 | Views : 2041
var myObject = new { RollNo = 1, StudentName = "Madhu", Height = 165.5 };
Console.WriteLine(myObject.GetType().ToString());

Output will be this

<>f__AnonymousType0`3[System.Int32,System.String,System.Double]

Comments or Responses

Login to post response