Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DAO
- {
- static void Main()
- {
- int year = 1997;
- FindAllCustomers(year, "Canada");
- }
- static void FindAllCustomers(int orderDate, string shipDestination)
- {
- using (NORTHWNDEntities db = new NORTHWNDEntities())
- {
- var orders = from order in db.Orders
- where order.OrderDate.Value.Year == orderDate && order.ShipCountry == shipDestination
- select order;
- foreach (var item in orders)
- {
- Console.WriteLine("Order made by: {0} with CustomerId: {1}", item.Customer.ContactName, item.Customer.CustomerID);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement