Beispiel #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, AspDotNetCoreDBContext db)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseSwagger();
                app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "MyAPI v1"));
            }

            //Database Create
            db.Database.EnsureCreated();
            app.UseHttpsRedirection();

            app.UseCors(x => x
                        .AllowAnyOrigin()
                        .AllowAnyMethod()
                        .AllowAnyHeader());

            app.UseAuthentication();
            app.UseRouting();
            app.UseAuthorization();
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
Beispiel #2
0
 public EmployeeService(AspDotNetCoreDBContext db, IMapper mapper)
 {
     _db     = db;
     _mapper = mapper;
 }
Beispiel #3
0
 public AuthService(AspDotNetCoreDBContext context)
 {
     _context = context;
 }