If the request does not contain a specific field, you do not need to include it as part of the where clause:
IQueyable<Users> user = from user in edmxObject.Users; if (model.FirstName != null) users = users.Where(user => user.FirstName.Contains(model.FirstName) if () users = users.Where(user => user.Age == model.Age);
You can conditionally set predicates in such a way as to make sure that you have only those conditions that you really need.
recursive
source share