예제 #1
0
파일: Program.cs 프로젝트: kimx/Examples
        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);
                };
            }
        }
예제 #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);
                }
                ;
            }
        }