Defining Simple Anoymous Type in C#

Published on June 21, 2015 by abundantcode

Filed under LINQ (General)

Last modified June 21, 2015

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 1942 times

To define an anonymous type in C# , we can use the var keyword . The syntax for defining the anonymous type in C# is as follows

var <variableName> = <Non-NULL Value>


var WebsiteName = "";

In the MSIL , the above code is similar to

string WebsiteName = "";
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment