Guest User

Untitled

a guest
Jun 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public IQueryable<Restaurant> All()
  2. {
  3. return from r in _context.Restaurants select new Restaurant(r.Id)
  4. {
  5. Name = r.Name
  6. };
  7. }
  8.  
  9. var results = Repository.All().Where(r => r.Name == "BW<3").ToList();
  10.  
  11. var results = Repository.All().Where(r => r.Id == new Guid("088ec7f4-63e8-4e3a-902f-fc6240df0a4b")).ToList();
  12.  
  13. The member 'BurningPlate.Models.Restaurant.Id' has no supported translation to SQL.
  14.  
  15. return from r in _context.Restaurants select new Restaurant()
  16. {
  17. Id=r.Id,
  18. Name = r.Name
  19. };
Add Comment
Please, Sign In to add comment