public Customer GetById(int id) { using (var db = new WebContextDB()) { return(db.Customer.FirstOrDefault(p => p.CustomerId == id)); } }
public Customer GetCompleteCustomerById(int id) { using (var db = new WebContextDB()) { return(db.Customer .Include(p => p.CustomerId) .FirstOrDefault(p => p.CustomerId == id)); } }
public List <Customer> GetListBySize(int size) { using (var db = new WebContextDB()) { return(db.Customer .OrderByDescending(p => p.LastName) .Take(size).ToList()); } }
public BaseRepository() { db = new Repository.WebContextDB(); }