The var keyword allows a programmer to implicitly type a variable at compile time. var declarations have the same type as explicitly declared variables.
var squaredNumber = 10 * 10;
var squaredNumberDouble = 10.0 * 10.0;
var builder = new StringBuilder();
var anonymousObject = new
{
One =...
//Example 1
int[] array = { 1, 5, 2, 10, 7 };
// Select squares of all odd numbers in the array sorted in descending order
IEnumerable<int> query = from x in array
where x % 2 == 1
orderby x descending
select x ...
Lambda Expresions are an extension of anonymous methods that allow for implicitly typed parameters and return values. Their syntax is less verbose than anonymous methods and follows a functional programming style.
using System;
using System.Collections.Generic;
using System.Linq;
...
Anonymous types provide a convenient way to encapsulate a set of read-only properties into a single object without having to explicitly define a type first. The type name is generated by the compiler and is not available at the source code level. The type of each property is inferred by the compiler...