Defining Simple Anoymous Type in C#


This content was proof-read by Grammarly. You can Try Grammary for FREE

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>

Eg:

var WebsiteName = "Abundantcode.com";

In the MSIL , the above code is similar to

string WebsiteName = "Abundantcode.com";
%d bloggers like this: