Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please choose topic: ");
            Console.WriteLine("1. Lazy Singleton");
            Console.WriteLine("2. Value - param type");
            Console.WriteLine("3. ref - param type");
            Console.WriteLine("4. out - param type");
            Console.WriteLine("5. params array - param type");
            Console.WriteLine("6. named - param type");
            Console.WriteLine("7. default - param type");

            Console.WriteLine("Please choose topic: ");
            int choice = Convert.ToInt16(Console.ReadLine());

            switch (choice)
            {
            case 1:
                LazySingletonFunc();
                break;

            case 2:
                ParameterTypes.ValueType();
                break;

            case 3:
                ParameterTypes.RefType();
                break;

            case 4:
                ParameterTypes.OutType();
                break;

            case 5:
                ParameterTypes.ParamsType();
                break;

            case 6:
                ParameterTypes.NamedType();
                break;

            case 7:
                ParameterTypes.DefaultType();
                break;

            default: break;
            }


            DuplicateVal();
            OverloadTest.func(5);
            //IENUMERATOR DEMO
            IenumeratorDemo.EnumFunc();
            //DI USING UNITY =======
            var container = new UnityContainer();

            container.RegisterType <IDBAccess, SQLDataAccess>();
            EmployeeDI emp = container.Resolve <EmployeeDI>();

            //========DI END========
            //  var container = new UnityContainer();
            //var section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
            //section.Containers.Default.Configure(container);

            //if (ConfigurationManager.GetSection("unity") != null)
            //{
            //    container.LoadConfiguration();

            //    Console.WriteLine();
            //    Console.WriteLine("After loading the config file:");
            //    EmployeeDI emp = container.Resolve<EmployeeDI>();

            //}

            LinqDemo();

            //  Test1 obj = new Test1("");
            //obj.func2();
            //Test1.func2();
            FactoryMethod();
            //Select_VS_SelectMany();
            //Singleton();
            // DelegatesFunc();
        }