Guest User

Untitled

a guest
Sep 14th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. Entity Framework generating sql queries without where clauses
  2. public List<Company> Query(Func<Company, bool> expression)
  3. {
  4. return MyDbContext.Instance().Company.Where(expression).ToList();
  5. }
  6.  
  7. public List<Company> GetLikeName(string textToSearch)
  8. {
  9. return MyDbContext.Instance().Company.Where(a => a.Contains(textToSearch)).ToList();
  10. }
  11.  
  12. public List<Company> Query(Expression<Func<Company, bool>> expression)
Add Comment
Please, Sign In to add comment