Example #1
0
        private static void AddRegion()
        {
            using (var context = new NorthwindEntities())
            {
                Region newRegion = new Region();
                newRegion.RegionDescription = "My New Region";

                context.Regions.Add(newRegion);
                context.SaveChanges();
            }
        }
Example #2
0
        private static void GetUSACustomers()
        {
            using (var context = new NorthwindEntities())
            {
                var USACustomers = context.Customers.Where(c => c.Country == "USA");

                foreach (var customer in USACustomers)
                {
                    Console.WriteLine("{0, -35} {1} {2}", customer.CompanyName, customer.Phone, customer.Country);
                }
            }
        }