0
relix3000 created
Hi! I have a simple question regarding performance as I've seen this situtation happen before and just wanted to make sure. When we use GetAll, from IRepository, and then filter results... is the whole table fetched from the table and then filtered or is it filtered before fetching to database? Thanks in advance.
3 Answer(s)
-
0
I had a look at the sql generated using SQL Profiler and in both the following cases the WHERE clause was added limiting the rows fetched from the table.
_myRepository .GetAll() .Where(e => e.AssetId == input.AssetId && e.StartTime >= input.StartTime) .WhereIf(input.EndTime.HasValue, e => e.EndTime <= input.EndTime)
_myRepository .GetAllList((a => a.Core.IsActive == true && a.Core.ApplicationId == input.ApplicationId));
-
0
Have an answer to this question?
Log in
and write your answer.