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