4
Vote

RepositoryBase returns full tables

description

There is a problem with the RepositoryBase that it returns everything (select *) from the database. The problem is probably due to the .ToList() method call in the GetAll function.
 
This means all filtering using the WebAPI filter are done on the webserver. If the database have millions of rows, this is a major issue.
 
Consider returning .AsQueryable() instead of .ToList(). At least make an additional method that allows the user to decide if he wants to return a list of everything or a query that can be filtered/ordered on the database server.
 
I added my own additional method to the RepositoryBase and the IRepository with the signature: IQueryable<T> Query();

comments