public List <Pub> GetPubs() { using (var pubContext = new PubDataContext()) { return(pubContext.Pubs.Include(pub => pub.Images).ToList()); } }
public Pub GetPub(int id) { using (var pubContext = new PubDataContext()) { return(pubContext.Pubs .Include(p => p.Comments) .Include(p => p.Images) .FirstOrDefault(p => p.Id == id)); } }