Exemplo n.º 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();
     }
 }
Exemplo n.º 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();
     }
 }
Exemplo n.º 3
0
 public List<String> GetCountries()
 {
     using (var db = new NorthwindDataContext())
     {
         return (from c in db.Customers select c.Country).Distinct().ToList();
     }
 }