Beispiel #1
0
        static void Main(string[] args)
        {
            Customer customer = new Customer
            {
                Name = "Michael Tsai"
            };

            using (var context = new SalesContext())
            {
                context.Customers.Add(customer);
                context.SaveChanges();

                foreach (var cust in context.Customers)
                {
                    Console.WriteLine("{0}: {1}", cust.Id, cust.Name);
                };
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Customer customer = new Customer
            {
                Name = "Michael Tsai"
            };

            using (var context = new SalesContext())
            {
                context.Customers.Add(customer);
                context.SaveChanges();

                foreach (var cust in context.Customers)
                {
                    Console.WriteLine("{0}: {1}", cust.Id, cust.Name);
                }
                ;
            }
        }