Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<Advertisement> GetLastetAdvertisement()
- {
- DemoContext _context = new DemoContext();
- using (_context)
- {
- return (from adv in _context.Advertisements
- .Include(a => a.SubCatagory.Catagory)
- .Include(a => a.City.Province.Country)
- .Include(a => a.User)
- .Include(a => a.Images)
- .Include(a => a.Status)
- .Include(a => a.Type)
- .OrderBy(x => x.PostedOn)
- select adv
- ).Take(12).ToList();
- }
- }
Add Comment
Please, Sign In to add comment