Guest User

Untitled

a guest
Jan 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public List<Advertisement> GetLastetAdvertisement()
  2. {
  3. DemoContext _context = new DemoContext();
  4. using (_context)
  5. {
  6. return (from adv in _context.Advertisements
  7. .Include(a => a.SubCatagory.Catagory)
  8. .Include(a => a.City.Province.Country)
  9. .Include(a => a.User)
  10. .Include(a => a.Images)
  11. .Include(a => a.Status)
  12. .Include(a => a.Type)
  13. .OrderBy(x => x.PostedOn)
  14.  
  15. select adv
  16. ).Take(12).ToList();
  17. }
  18. }
Add Comment
Please, Sign In to add comment