Real World Example for Anonymous Types of C# .NET

Viewed 10912

I am learning Anonymous Type in C#, I have understood how they are defined and used. Below is a sample code I have tried for Anonymous Type.

var myType = new {
Name = "Yasser",
City = "Mumbai"
};
Console.WriteLine("Name: {0}, Type: {1}", myType.Name, myType.City);

My Question

Where in real world scenario, will these be used ? Can anyone give me an example or scenario where these Anonymous Type could be used.

6 Answers
Related