Anonymous Type

noun

say it: “uh-NON-ih-mus type” /əˈnɒnɪməs taɪp/

A C# object created on the spot with new { ... }, with no class written for it, often for parameters or results.

What is Anonymous Type in C#?

Anonymous Type — A compiler-created read-only type defined from an object initializer.

class OrderView
{
    object summary = new { Item = "Tea", Quantity = 2 };
}

In a sentence

  • “Dapper gets its parameters from an anonymous type: new { Id = 7 }.”

Level: Freelancer · More C# terms at this level

Updated