public List<Customer> GetCustomersByCountry(string country) { using (var db = new NorthwindDataContext()) { return (from c in db.Customers where c.Country == country select c).ToList(); } }
public Customer GetCustomer(string custID) { using (var db = new NorthwindDataContext()) { return (from c in db.Customers where c.CustomerID == custID select c).SingleOrDefault(); } }
public List<String> GetCountries() { using (var db = new NorthwindDataContext()) { return (from c in db.Customers select c.Country).Distinct().ToList(); } }