Пример #1
0
 public List<Customer> GetCustomersByCountry(string country)
 {
     using (var db = new NorthwindDataContext())
     {
         return (from c in db.Customers where c.Country == country select c).ToList();
     }
 }
Пример #2
0
 public Customer GetCustomer(string custID)
 {
     using (var db = new NorthwindDataContext())
     {
         return (from c in db.Customers where c.CustomerID == custID select c).SingleOrDefault();
     }
 }
Пример #3
0
 public List<String> GetCountries()
 {
     using (var db = new NorthwindDataContext())
     {
         return (from c in db.Customers select c.Country).Distinct().ToList();
     }
 }