Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var services = new ServiceCollection()
                           .Configure <DatabaseConnectionOptions>
                               (_ =>
            {
                _.Srv = args[0];
                _.Cat = args[1];
                _.Usr = args[2];
                _.Pwd = args[3];
            })
                           .AddDbContextWithConfiguration();


            var provider = services.BuildServiceProvider();

            using (var scope = provider.CreateScope())
            {
                //SimpleStartsWithQuery(scope);
                //BatchQueries.SimpleSelectByIds(scope);
                //BatchQueries.SimpleSelectByIdsWithInlining1(scope); // +
                //BatchQueries.SimpleSelectByIdsWithInlining2(scope); // -

                //QueryRelatedData.WithoutInclude(scope);
                //QueryRelatedData.GroupingAndSorting1(scope);

                //Projections.GroupingAndSortingFluent(scope);
                Projections.GroupingAndSortingLinq(scope);

                //Immutability.ShowImmutability();
            }



            Console.ReadKey();
        }