private void DumpTable(int tableNumber) { Console.WriteLine(""); switch (tableNumber) { case 1: { int[] fieldLengths = new int[] { 20, 20 }; string[] fieldNames = new string[] { "UserId", "Event" }; FooService = FooService ?? new FooDAL(_iconfiguration); List <FooModel> list = FooService.ListFooTable(); PrintDbTableHeader(fieldLengths, fieldNames); foreach (var listItem in list) { Console.Write($"|"); PrintDbFieldColumn(fieldLengths[0], listItem.UserId); PrintDbFieldColumn(fieldLengths[1], listItem.Event); Console.WriteLine(""); PrintDbTableBoarder(fieldLengths); } break; } default: Console.WriteLine("NOT FOUND: The Table is not in the list of tables"); break; } Console.WriteLine(""); Console.WriteLine(""); }
private List <FooModel> RetrieveFooUsersWithAllEvents() { FooService = FooService ?? new FooDAL(_iconfiguration); return(FooService.GetFooUsersWithAllEvents()); }
private string GetConnectionString() { FooService = FooService ?? new FooDAL(_iconfiguration); return(FooService.GetConnectionString()); }