Пример #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, EmployeesDataContext dbContext)
        {
            dbContext.Database.Migrate();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseSpaStaticFiles();

            if (!env.IsDevelopment())
            {
                app.UseSpaStaticFiles();
            }

            app.UseSwagger();

            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "API V1");
            });

            app.UseRouting();

            app.UseEndpoints(endpoint =>
            {
                endpoint.MapControllers();
            });

            app.UseSpa(spa =>
            {
                spa.Options.SourcePath = "ClientApp";
                if (env.IsDevelopment())
                {
                    spa.UseAngularCliServer(npmScript: "start");
                }
            });
        }
 public EmployeesRepository(EmployeesDataContext employeesDataContext)
 {
     this.employeesDataContext = employeesDataContext;
 }
 public EmployeeController(EmployeesDataContext context)
 {
     Context = context;
 }
 public EmployeeController(EmployeesDataContext context, IMapper mapper, MapperConfiguration mapperConfig)
 {
     Context      = context;
     Mapper       = mapper;
     MapperConfig = mapperConfig;
 }