Skip to content
ImaginaryDevelopment edited this page Apr 15, 2013 · 3 revisions

Take dynamic queries from having to hand write the LINQ expression per filter option, into self-generating framework handled reusable code.

        if(userFilteredById)
          query=query.where(x=> x.Id == userId)
        if(userFilteredByName)
          query=query.Where(x=> x.Name.Contains(userName)

becomes

IQueryable<User> Users{get{ return _dbContext.Users;}}

Clone this wiki locally