i

ASP.Net A Complete Guide

Method Extension

It is the same as calling the existing method extension. The method syntax consists of extension methods and Lambda expression.

Example:

IList EmployeeList = new List() {

        new Employee() { EmployeeID = 1, EmployeeName = "varsha", Age = 10} ,

        new Employee() { EmployeeID = 2, EmployeeName = "vikas",  Age = 22 }        

    };

var employee = EmployeeList.Where(E => E.Age > 12 && E.Age < 20)

                                  .ToList();