I have the following IQueryable where, with multiple evaluations, but I'm noticing that this resulted in 9 Queries getting executed against the server? When in reality it should only be one?
var datafound = db.CustomersData
.Where(x => x.EntryDate == eod.EntryDate);
if (!string.IsNullOrWhiteSpace(eod.Type))
datafound = datafound.Where(x => x.Type == eod.Type);
if (!string.IsNullOrWhiteSpace(eod.LastName))
datafound = datafound.Where(x => x.LastName.Contains(eod.LastName));
if (!string.IsNullOrWhiteSpace(eod.Address))
datafound = datafound.Where(x => x.Address.Contains(eod.Address));
if (!string.IsNullOrWhiteSpace(eod.BuildingName))
datafound = datafound.Where(x => x.BuildingName.Contains(eod.BuildingName));
.....
.....
return datafound.ToList();