Answers for "anonymous types in c# example"

C#
0

anonymous types in c# example

var v = new { Amount = 108, Message = "Hello" };

// Rest the mouse pointer over v.Amount and v.Message in the following
// statement to verify that their inferred types are int and string.
Console.WriteLine(v.Amount + v.Message);
Posted by: Guest on August-26-2021
0

anonymous types in c# example

var productQuery =
    from prod in products
    select new { prod.Color, prod.Price };

foreach (var v in productQuery)
{
    Console.WriteLine("Color={0}, Price={1}", v.Color, v.Price);
}
Posted by: Guest on August-26-2021

C# Answers by Framework

Browse Popular Code Answers by Language