static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("欢迎来到.Net高级班VIP课程,今晚Eleven老师为大家带来EntityFramework6");
                {
                    //using (JDDbContext context = new JDDbContext())
                    //{
                    //    User user = context.Users.Find(5);
                    //}
                    {
                        //Console.WriteLine("***************************");
                        //EFQueryTest.Show();
                    }
                    //{
                    //    Console.WriteLine("***************************");
                    //    EFStateTest.Show();
                    //}
                    //{
                    //    Console.WriteLine("***************************");
                    //    EFStateTest.Show();
                    //}
                    {
                        //Console.WriteLine("***************************");
                        //ContextLifetimeTest.Show();
                    }
                    //{
                    //    Console.WriteLine("***************************");
                    //    EFQueryAdvancedTest.Show();
                    //}
                    //{
                    //    Console.WriteLine("***************************");
                    //    //NavigationTest.ShowQuery();
                    //    //NavigationTest.ShowInsert();
                    //    NavigationTest.ShowDelete();
                    //}

                    {
                        Console.WriteLine("***************************");
                        IOCTest.Show();
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.Read();
        }
示例#2
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("欢迎来到.net高级班vip课程,今天是IOC");
                //{
                //    AndroidPhone phone = new AndroidPhone();
                //}
                //{
                //    IPhone phone = new AndroidPhone();
                //}
                //{
                //    IPhone phone = ObjectFactory.CreatePhone();//容器的雏形
                //}

                IOCTest.Show();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.Read();
        }