static void Main(string[] args) { IRepository <Emploee> repo = new EmploeeRepository(@"..\..\..\..\Emploees.txt"); IPrinter printer = new ConsolePrinter(); IEmploeeSearchService empSrevice = new EmploeeSearchService(repo); IRunner empRunner = new EmploeeSearchRunner(printer, empSrevice); var cuttingRunner = CuttingOerationInitialize(printer); var menu = new Dictionary <string, IRunner>() { { "1", empRunner }, { "2", cuttingRunner } }; Console.WriteLine("choose task (1/2)"); var temp = Console.ReadLine(); try { menu.Where(x => x.Key == temp).FirstOrDefault().Value.Start(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
static Unit() { Context = new MyAppDbContext( new DbContextOptionsBuilder <MyAppDbContext>() .UseSqlServer(new SqlConnectionStringBuilder { DataSource = "127.0.0.1", InitialCatalog = "Univercity", IntegratedSecurity = true }.ConnectionString) .Options); Context.Database.EnsureDeleted(); Context.Database.EnsureCreated(); AuthorRepository = new AuthorRepository(Context); BookRepository = new BookRepository(Context); CategoryRepository = new CategoryRepository(Context); DepartmentRepository = new DepartmentRepository(Context); ECardRepository = new ECardsRepository(Context); EmployeeRepository = new EmploeeRepository(Context); FacultyRepository = new FacultyRepository(Context); GroupRepository = new GroupRepository(Context); LibrarianRepository = new LibrarianRepository(Context); PressRepository = new PressRepository(Context); SCardRepository = new SCardsRepository(Context); StudentRepository = new StudentRepository(Context); ThemeRepository = new ThemeRepository(Context); }
static void Main(string[] args) { IRepository <Emploee> repo = new EmploeeRepository(@"..\..\..\..\Emploees.txt"); IPrinter printer = new ConsolePrinter(); IEmploeeSearchService empSrevice = new EmploeeSearchService(repo); IRunner empRunner = new EmploeeSearchRunner(printer, empSrevice); empRunner.Start(); }