Ejemplo n.º 1
0
        private static void Main()
        {
            do
            {
                ShowOptions();
                switch (Console.ReadLine())
                {
                case "1":
                    var openDbDemo = new OpenDatabaseSamples();
                    openDbDemo.RunAll();
                    break;

                case "2":
                    var allMethodDemo = new AllMethodSamples();
                    allMethodDemo.RunAll();
                    break;

                case "3":
                    var findByMethodDemo = new FindByMethodSamples();
                    findByMethodDemo.RunAll();
                    break;

                case "4":
                    var findAllByMethodDemo = new FindAllByMethodSamples();
                    findAllByMethodDemo.RunAll();
                    break;

                case "5":
                    var getMethodDemo = new GetMethodSamples();
                    getMethodDemo.RunAll();
                    break;

                case "6":
                    var findMethodDemo = new FindMethodSamples();
                    findMethodDemo.RunAll();
                    break;

                case "7":
                    var findAllMethodDemo = new FindAllMethodSamples();
                    findAllMethodDemo.RunAll();
                    break;

                case "8":
                    var columnSelectionDemo = new ColumnSelectionSamples();
                    columnSelectionDemo.RunAll();
                    break;

                case "9":
                    var basicWhereDemo = new WhereMethodSamples();
                    basicWhereDemo.RunAll();
                    break;

                case "a":
                case "A":
                    var commonSearchesDemo = new WhereConditionSamples();
                    commonSearchesDemo.RunAll();
                    break;

                case "b":
                case "B":
                    var countDistinctDemo = new CountDistinctSamples();
                    countDistinctDemo.RunAll();
                    break;

                case "c":
                case "C":
                    var getCountDemo = new GetCountMethodSamples();
                    getCountDemo.RunAll();
                    break;

                case "d":
                case "D":
                    var getCountByDemo = new GetCountByMethodSamples();
                    getCountByDemo.RunAll();
                    break;

                case "e":
                case "E":
                    var pocoDemo = new PocoMethodSamples();
                    pocoDemo.RunAll();
                    break;

                case "f":
                case "F":
                    var scalarDemo = new ToScalarSamples();
                    scalarDemo.RunAll();
                    break;

                case "g":
                case "G":
                    var scalarCollectionDemo = new ToScalarCollectionSamples();
                    scalarCollectionDemo.RunAll();
                    break;

                case "h":
                case "H":
                    var naturalJoinDemo = new NaturalJoinSamples();
                    naturalJoinDemo.RunAll();
                    break;

                case "i":
                case "I":
                    var explicitJoinDemo = new ExplicitJoinSamples();
                    explicitJoinDemo.RunAll();
                    break;

                case "j":
                case "J":
                    var outerJoinDemo = new OuterJoinSamples();
                    outerJoinDemo.RunAll();
                    break;

                case "k":
                case "K":
                    var leftJoinDemo = new LeftJoinSamples();
                    leftJoinDemo.RunAll();
                    break;

                case "l":
                case "L":
                    var lazyEagerDemo = new LazyVsEagerLoadingSamples();
                    lazyEagerDemo.RunAll();
                    break;

                case "m":
                case "M":
                    var existsDemo = new ExistsMethodSamples();
                    existsDemo.RunAll();
                    break;

                case "n":
                case "N":
                    var existsByDemo = new ExistsByMethodSamples();
                    existsByDemo.RunAll();
                    break;

                case "o":
                case "O":
                    var orderByDemo = new OrderByMethodSamples();
                    orderByDemo.RunAll();
                    var orderByDescDemo = new OrderByDescendingMethodSamples();
                    orderByDescDemo.RunAll();
                    break;

                case "p":
                case "P":
                    var thenByDemo = new ThenByMethodSamples();
                    thenByDemo.RunAll();
                    break;

                case "q":
                case "Q":
                    var withDemo = new WithMethodSamples();
                    withDemo.RunAll();
                    break;

                case "r":
                case "R":
                    var havingDemo = new HavingMethodSamples();
                    havingDemo.RunAll();
                    break;

                case "x":
                case "X":
                    Console.WriteLine("Fin");
                    return;

                default:
                    Console.WriteLine("Not a valid option. Choose again");
                    break;
                }
            } while (true);
        }
Ejemplo n.º 2
0
 private static void Main()
 {
     do
     {
         ShowOptions();
         switch (Console.ReadLine().ToLower())
         {
             case "1":
                 var openDbDemo = new OpenDatabaseSamples();
                 openDbDemo.RunAll();
                 break;
             case "2":
                 var allMethodDemo = new AllMethodSamples();
                 allMethodDemo.RunAll();
                 break;
             case "3":
                 var findByMethodDemo = new FindByMethodSamples();
                 findByMethodDemo.RunAll();
                 break;
             case "4":
                 var findAllByMethodDemo = new FindAllByMethodSamples();
                 findAllByMethodDemo.RunAll();
                 break;
             case "5":
                 var getMethodDemo = new GetMethodSamples();
                 getMethodDemo.RunAll();
                 break;
             case "6":
                 var findMethodDemo = new FindMethodSamples();
                 findMethodDemo.RunAll();
                 break;
             case "7":
                 var findAllMethodDemo = new FindAllMethodSamples();
                 findAllMethodDemo.RunAll();
                 break;
             case "8":
                 var columnSelectionDemo = new ColumnSelectionSamples();
                 columnSelectionDemo.RunAll();
                 break;
             case "9":
                 var basicWhereDemo = new WhereMethodSamples();
                 basicWhereDemo.RunAll();
                 break;
             case "a":
                 var commonSearchesDemo = new WhereConditionSamples();
                 commonSearchesDemo.RunAll();
                 break;
             case "b":
                 var countDistinctDemo = new CountDistinctSamples();
                 countDistinctDemo.RunAll();
                 break;
             case "c":
                 var getCountDemo = new GetCountMethodSamples();
                 getCountDemo.RunAll();
                 break;
             case "d":
                 var getCountByDemo = new GetCountByMethodSamples();
                 getCountByDemo.RunAll();
                 break;
             case "e":
                 var pocoDemo = new PocoMethodSamples();
                 pocoDemo.RunAll();
                 break;
             case "f":
                 var scalarDemo = new ToScalarSamples();
                 scalarDemo.RunAll();
                 break;
             case "g":
                 var scalarCollectionDemo = new ToScalarCollectionSamples();
                 scalarCollectionDemo.RunAll();
                 break;
             case "h":
                 var naturalJoinDemo = new NaturalJoinSamples();
                 naturalJoinDemo.RunAll();
                 break;
             case "i":
                 var explicitJoinDemo = new ExplicitJoinSamples();
                 explicitJoinDemo.RunAll();
                 break;
             case "j":
                 var outerJoinDemo = new OuterJoinSamples();
                 outerJoinDemo.RunAll();
                 break;
             case "k":
                 var leftJoinDemo = new LeftJoinSamples();
                 leftJoinDemo.RunAll();
                 break;
             case "l":
                 var lazyEagerDemo = new LazyVsEagerLoadingSamples();
                 lazyEagerDemo.RunAll();
                 break;
             case "m":
                 var existsDemo = new ExistsMethodSamples();
                 existsDemo.RunAll();
                 break;
             case "n":
                 var existsByDemo = new ExistsByMethodSamples();
                 existsByDemo.RunAll();
                 break;
             case "o":
                 var orderByDemo = new OrderByMethodSamples();
                 orderByDemo.RunAll();
                 var orderByDescDemo = new OrderByDescendingMethodSamples();
                 orderByDescDemo.RunAll();
                 break;
             case "p":
                 var thenByDemo = new ThenByMethodSamples();
                 thenByDemo.RunAll();
                 break;
             case "q":
                 var withDemo = new WithMethodSamples();
                 withDemo.RunAll();
                 break;
             case "r":
                 var havingDemo = new HavingMethodSamples();
                 havingDemo.RunAll();
                 break;
             case "s":
                 //var lenDemo = new LengthMethodSamples();
                 //lenDemo.RunAll();
                 var firstDemo = new FirstMethodSamples();
                 firstDemo.RunAll();
                 //var firstOrDefDemo = new FirstOrDefaultMethodSamples();
                 //firstOrDefDemo.RunAll();
                 break;
             case "x":
                 Console.WriteLine("Fin");
                 return;
             default:
                 Console.WriteLine("Not a valid option. Choose again");
                 break;
         }
     } while (true);
 }
Ejemplo n.º 3
0
 private static void Main()
 {
     do
     {
         ShowOptions();
         switch (Console.ReadLine())
         {
             case "1":
                 var openDbDemo = new OpenDatabaseSamples();
                 openDbDemo.RunAll();
                 break;
             case "2":
                 var allMethodDemo = new AllMethodSamples();
                 allMethodDemo.RunAll();
                 break;
             case "3":
                 var findByMethodDemo = new FindByMethodSamples();
                 findByMethodDemo.RunAll();
                 break;
             case "4":
                 var findAllByMethodDemo = new FindAllByMethodSamples();
                 findAllByMethodDemo.RunAll();
                 break;
             case "5":
                 var getMethodDemo = new GetMethodSamples();
                 getMethodDemo.RunAll();
                 break;
             case "6":
                 var findMethodDemo = new FindMethodSamples();
                 findMethodDemo.RunAll();
                 break;
             case "7":
                 var findAllMethodDemo = new FindAllMethodSamples();
                 findAllMethodDemo.RunAll();
                 break;
             case "8":
                 var columnSelectionDemo = new ColumnSelectionSamples();
                 columnSelectionDemo.RunAll();
                 break;
             case "9":
                 var basicWhereDemo = new WhereMethodSamples();
                 basicWhereDemo.RunAll();
                 break;
             case "a":
             case "A":
                 var commonSearchesDemo = new WhereConditionSamples();
                 commonSearchesDemo.RunAll();
                 break;
             case "b":
             case "B":
                 var countDistinctDemo = new CountDistinctSamples();
                 countDistinctDemo.RunAll();
                 break;
             case "c":
             case "C":
                 var getCountDemo = new GetCountMethodSamples();
                 getCountDemo.RunAll();
                 break;
             case "d":
             case "D":
                 var getCountByDemo = new GetCountByMethodSamples();
                 getCountByDemo.RunAll();
                 break;
             case "e":
             case "E":
                 var pocoDemo = new PocoMethodSamples();
                 pocoDemo.RunAll();
                 break;
             case "f":
             case "F":
                 var scalarDemo = new ToScalarSamples();
                 scalarDemo.RunAll();
                 break;
             case "g":
             case "G":
                 var scalarCollectionDemo = new ToScalarCollectionSamples();
                 scalarCollectionDemo.RunAll();
                 break;
             case "h":
             case "H":
                 var naturalJoinDemo = new NaturalJoinSamples();
                 naturalJoinDemo.RunAll();
                 break;
             case "i":
             case "I":
                 var explicitJoinDemo = new ExplicitJoinSamples();
                 explicitJoinDemo.RunAll();
                 break;
             case "j":
             case "J":
                 var outerJoinDemo = new OuterJoinSamples();
                 outerJoinDemo.RunAll();
                 break;
             case "k":
             case "K":
                 var leftJoinDemo = new LeftJoinSamples();
                 leftJoinDemo.RunAll();
                 break;
             case "l":
             case "L":
                 var lazyEagerDemo = new LazyVsEagerLoadingSamples();
                 lazyEagerDemo.RunAll();
                 break;
             case "m":
             case "M":
                 var existsDemo = new ExistsMethodSamples();
                 existsDemo.RunAll();
                 break;
             case "n":
             case "N":
                 var existsByDemo = new ExistsByMethodSamples();
                 existsByDemo.RunAll();
                 break;
             case "x":
             case "X":
                 Console.WriteLine("Fin");
                 return;
             default:
                 Console.WriteLine("Not a valid option. Choose again");
                 break;
         }
     } while (true);
 }