static void Main(string[] args) { //configuration AppConfiguration.Configure(); var csvParser = new CsvParser(); //read employee category csv file var employees = csvParser.Parse <Employee>(@"CsvFiles\Employee.csv"); //read department category csv file var departments = csvParser.Parse <Department>(@"CsvFiles\Department.csv"); // foreach(var employee in employees) // { // Console.WriteLine($"{employee.Name},{employee.Role},{employee.Email}"); // } var employeeContext = new EmployeeContext(AppConfiguration.Configuration); //employeeContext.Database.EnsureDeleted(); //employeeContext.Database.EnsureCreated(); var unitOfWork = new UnitOfWork(employeeContext); unitOfWork.EmployeeRepository.AddRange(employees); unitOfWork.DepartmentRepository.AddRange(departments); unitOfWork.Save(); Console.ReadLine(); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } AppConfiguration.Configure(app); }
public static int Main(string[] args) { var configuration = AppConfiguration.Configure(); LogConfigure.CreateLogger(configuration); try { Log.Information("Starting AspNetCoreGAE"); BuildWebHost(args, configuration).Run(); return(0); } catch (Exception ex) { Log.Fatal(ex, "AspNetCoreGAE terminated unexpectedly"); return(1); } finally { Log.CloseAndFlush(); } }
public IConfigurationRoot Configure() => AppConfiguration.Configure();
public Startup(IHostingEnvironment environment) { Configuration = AppConfiguration.Configure(environment.EnvironmentName, environment.ContentRootPath); }