Esempio n. 1
0
 public Customer GetCustomerByID(string id)
 {
     using (var contexto = new NorthWindDataContext())
     {
         return 
             (
                 from c in contexto.Customers
                     where c.CustomerID==id
                 select c
             )
             .FirstOrDefault();
     }
 }
Esempio n. 2
0
 public IList<string> GetCountries()
 {
     using (var contexto = new NorthWindDataContext())
     {
         return
             (
                 from c in contexto.Customers
                 select c.Country
             )
             .Distinct()
             .ToList();
     }
 }
Esempio n. 3
0
        public IList<Customer> GetCustomerByCountry(string country) {
            using (var contexto = new NorthWindDataContext())
            {
                return
                (
                    from c in contexto.Customers
                        where c.Country == country
                    select c

                )
                .ToList();
            }
        }