I'm using Entity framework in my ASP.NET MVC project. I need to know that if I'm dealing correctly with the following scenario.
Lets say my Employee table has over 100000 records and I have to apply various filtering according to the client requirement.
So I write 1 method ReadAll() to retrieve all the records from the database and then apply filtering to the datasource using lambda expressions.
Ex: Get employee by ID
public List<Employee> ReadAll()
{
// return List<Employee>
}
private Employee(int id)
{
Employee obj=ReadAll().where(o=>o.empID == id).First();
}
I'm trying to use one read all method because there are various filtering to be applied and I do not have to write separate database access methods to each of them.
Will this affect my application performance adversely?