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