Example #1
0
 /*
  * This method returns a list of distinct countries from the customer table in the northwind DB
  *
  */
 public List <string> getCountries()
 {
     using (var context = new NorthWNDDataContext())
     {
         List <string> myList = (from data in context.Customers
                                 select data.Country).Distinct().ToList();
         return(myList);
     }
 }
Example #2
0
 public Customer getCustomer(string customerID)
 {
     using (var context = new NorthWNDDataContext())
     {
         Customer selectedCutsomer = (from data in context.Customers
                                      where data.CustomerID == customerID
                                      select data).SingleOrDefault();
         return(selectedCutsomer);
     }
 }
Example #3
0
 /*
  */
 public List <Customer> getAllCustomers(string country)
 {
     using (var context = new NorthWNDDataContext())
     {
         List <Customer> allCustomers = (from data in context.Customers
                                         where data.Country == country
                                         select data).ToList();
         return(allCustomers);
     }
 }
 public List <Customer> getCustomerDetail(string customerID)
 {
     using (var context = new NorthWNDDataContext())
     {
         List <Customer> customerList = (from data in context.Customers
                                         where data.CustomerID == customerID
                                         select data).ToList();
         return(customerList);
     }
 }
 public List <Order> getOrders(DateTime orderDate)
 {
     using (var context = new NorthWNDDataContext())
     {
         List <Order> orderList = (from data in context.Orders
                                   where data.OrderDate == orderDate
                                   select data).ToList();
         return(orderList);
     }
 }