Beispiel #1
0
 public Customer GetById(int id)
 {
     using (var db = new WebContextDB())
     {
         return(db.Customer.FirstOrDefault(p => p.CustomerId == id));
     }
 }
Beispiel #2
0
 public Customer GetCompleteCustomerById(int id)
 {
     using (var db = new WebContextDB())
     {
         return(db.Customer
                .Include(p => p.CustomerId)
                .FirstOrDefault(p => p.CustomerId == id));
     }
 }
Beispiel #3
0
 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();
 }