IEnumerable<T> Interface in C #
IEnumerable interface is a simple iteration over a collection of a specified type.It has Method GetEnumerator() that iterates through the collection.
Use: Mainly used to work with in memory data i.e List,Array
Example: IEnumerable<Product> products = db.employee.Take(3);
IQueryable Interface in C #
It is basically used to evaluate queries against a specific data source.
Use: Used to query database.e.g. iin LINQ
Example: IQueryable<Product> products = db.employee.Take(3);
Difference:
In IEnumerable All employees will be loaded After Loading all data program will filter
Query run on database- Select * from Employees
In IQueryable Data will be filterd on Database Program will get only top 3 recoreds
Query run on database- Select TOP 3 * from Employees