コード例 #1
0
ファイル: Program.cs プロジェクト: khosevb/CsvTestReader
        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();
        }
コード例 #2
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            AppConfiguration.Configure(app);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: mazhestiq/test
        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();
            }
        }
コード例 #4
0
 public IConfigurationRoot Configure() => AppConfiguration.Configure();
コード例 #5
0
ファイル: Startup.cs プロジェクト: educonz/TesteM
 public Startup(IHostingEnvironment environment)
 {
     Configuration = AppConfiguration.Configure(environment.EnvironmentName, environment.ContentRootPath);
 }