MarketAnonymous type
Company Profile

Anonymous type

Anonymous types are a feature of C# 3.0, Visual Basic .NET 9.0, Oxygene, Scala and Go that allows data types to encapsulate a set of properties into a single object without having to first explicitly define a type. This is an important feature for the SQL-like LINQ feature that is integrated into C# and VB.net. Since anonymous types do not have a named type, they must be stored in variables declared using the var keyword, telling the C# compiler to use type inference for the variable. The properties created are read-only in C#, however, they are read-write in VB.net.

Examples
C# var person = new { firstName = "John", lastName = "Smith" }; Console.WriteLine(person.lastName); Output: Go var person struct { firstName string; lastName string } person.firstName = "John" person.lastName = "Smith" OCaml let person = object val firstName = "John" val lastName = "Smith" end;; Oxygene var person := new class(firstName := 'John', lastName := 'Smith'); PHP $person = new class { public $firstName = "John"; public $lastName = "Smith"; }; Scala val person = new { val firstName = "John"; val lastName = "Smith" } Visual Basic .NET Dim person = New With {.firstName = "John", .lastName = "Smith"} ==See also==
tickerdossier.comtickerdossier.substack.com