Query operators are functions that transforms a sequence. Sequence is passed to query operator as an input parameter. As a result, query operator change the sequence element and returns a result.

For example, there is a "Where" query operator in LINQ which takes an input sequence and a predicate to filter the elements. As an output it returns only those elements in a sequence that have matching filter condition.

All LINQ language is based on extension methods. Extension methods are static methods of a static class that can be invoked just like an instance method. These methods are useful when we have to add new behaviors to an existing class without modifying the class.

In the above example we have created a anonymous type which has two public fields FirstName and LastName. We have not specified any class name after the new keyword. This new anonymous type has only two properties and no methods.

Delegates allows us to store a reference of functions that can be executed at appropriate time. In the delegate we can only store those functions that have matching parameters and return types.

For example, if we declare a delegate that accept an int parameter and returns string result. Then in that delegate we can only assign a reference to those functions that take int as a single parameter and returns string result.

In the above example, we declare a simple delegate CalcSum which takes two int parameters and return int result.

We declare two functions Sum and WrongSumFunction. Only Sum function has two int parameters and returns in result. We can easily assign this method to CalcSum instance. The second function WrongSumFunction takes only one parameter and returns int results. Because WrongSumFunction has only one int parameter we can not assign that method to CalcSum delegate instance as shown in the above example and it gives error at compile time.

Lambda Expressions is just a shortcut way to writing anonymous methods. => is a lambda operator. On the left of lambda operator we specify the input parameters and on the right side we write the body of the method.