Exemplo n.º 1
0
        static void Main(string[] args)
        {
            AppHelper.Setup();
            MultiTenantHelper.Setup("MyLOB");

            // EF 6.0 Log
            //DbInterception.Add(new NLogCommandInterceptor());

            bool exit = false;

            while (!exit)
            {
                Console.Clear();
                Console.WriteLine("EasyLOB Shell\n");
                Console.WriteLine("<0> EXIT");
                Console.WriteLine("<1> Application Demo");
                Console.WriteLine("<2> Persistence Demo");
                Console.WriteLine("<3> EDM Demo");
                Console.WriteLine("<4> Demo");
                Console.Write("\nChoose an option... ");

                ConsoleKeyInfo key = Console.ReadKey();
                Console.WriteLine();

                switch (key.KeyChar) // <ENTER> = '\r'
                {
                case ('0'):
                    exit = true;
                    break;

                case ('1'):
                    ApplicationDemo();
                    break;

                case ('2'):
                    PersistenceDemo();
                    break;

                case ('3'):
                    EDMDemo();
                    break;

                case ('4'):
                    Demo();
                    break;
                }

                //if (!exit && "".IndexOf(key.KeyChar) >= 0)
                //{
                //    Console.Write("\nPress <KEY> to continue... ");
                //    Console.ReadKey();
                //}
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            // Autofac
            AppDIAutofacHelper.Setup(new ContainerBuilder());
            // Unity
            //AppDIUnityHelper.Setup(new UnityContainer());

            MultiTenantHelper.Setup("MyLOB");

            // EF 6.0 Log
            //ILogManager logManager = DIHelper.DIManager.GetService<ILogManager>();
            //DbInterception.Add(new NLogCommandInterceptor(logManager));

            bool exit = false;

            while (!exit)
            {
                Console.Clear();
                Console.WriteLine("EasyLOB Shell\n");
                Console.WriteLine("<0> EXIT");
                Console.WriteLine("<1> Application Demo");
                Console.WriteLine("<2> Persistence Demo");
                Console.WriteLine("<3> AutoMapper Demo");
                Console.WriteLine("<4> CRUD Demo");
                Console.WriteLine("<5> LINQ Demo");
                Console.WriteLine("<6> EDM Demo");
                Console.WriteLine("<7> Demo");
                Console.Write("\nChoose an option... ");

                ConsoleKeyInfo key = Console.ReadKey();
                Console.WriteLine();

                switch (key.KeyChar) // <ENTER> = '\r'
                {
                case ('0'):
                    exit = true;
                    break;

                case ('1'):
                    ApplicationDemo();
                    break;

                case ('2'):
                    PersistenceDemo();
                    break;

                case ('3'):
                    AutoMapperDemo();
                    break;

                case ('4'):
                    CRUDDemo();
                    break;

                case ('5'):
                    LINQDemo();
                    break;

                case ('6'):
                    EDMDemo();
                    break;

                case ('7'):
                    Demo();
                    break;
                }

                //if (!exit)
                //{
                //    Console.Write("\nPress <KEY> to continue... ");
                //    Console.ReadKey();
                //}
            }
        }