|
|
@@ -23,40 +23,39 @@ namespace Warhammer
|
|
|
// This method gets called by the runtime. Use this method to add services to the container.
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
|
{
|
|
|
- services.AddCors(o => o.AddPolicy("MyPolicy", builder =>
|
|
|
- {
|
|
|
- builder.AllowAnyOrigin()
|
|
|
- .AllowAnyMethod()
|
|
|
- .AllowAnyHeader();
|
|
|
- }));
|
|
|
+ //services.AddCors(o => o.AddPolicy("MyPolicy", builder =>
|
|
|
+ //{
|
|
|
+ // builder.AllowAnyOrigin()
|
|
|
+ // .AllowAnyMethod()
|
|
|
+ // .AllowAnyHeader();
|
|
|
+ //}));
|
|
|
|
|
|
- services.AddControllersWithViews();
|
|
|
services.AddMvc();
|
|
|
services.AddHttpClient();
|
|
|
+ services.AddControllersWithViews();
|
|
|
services.AddRazorPages();
|
|
|
|
|
|
services.AddDbContext<DeathwatchDbContext>(options =>
|
|
|
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
|
|
|
|
|
|
services.AddTransient(typeof(IAbstractRepository<>), typeof(AbstractRepository<>));
|
|
|
+ services.AddTransient<IPlayerService, PlayerService>();
|
|
|
services.AddTransient<IPlayerRepository, PlayerRepository>();
|
|
|
|
|
|
- services.AddTransient<IPlayerService, PlayerService>();
|
|
|
|
|
|
}
|
|
|
|
|
|
- // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
|
{
|
|
|
- //if (env.IsDevelopment())
|
|
|
- //{
|
|
|
- // app.UseDeveloperExceptionPage();
|
|
|
- //}
|
|
|
- //else
|
|
|
- //{
|
|
|
- //app.UseExceptionHandler("/Home/Error");
|
|
|
- // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
|
- //}
|
|
|
+ if (env.IsDevelopment())
|
|
|
+ {
|
|
|
+ app.UseDeveloperExceptionPage();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ app.UseExceptionHandler("/Home/Error");
|
|
|
+ //The default HSTS value is 30 days.You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
|
+ }
|
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
app.UseStaticFiles();
|