Convert to new namespace stuff and implicit usings
This commit is contained in:
@@ -1,72 +1,65 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Prospect.Server.Api.Config;
|
||||
using Prospect.Server.Api.Converters;
|
||||
using Prospect.Server.Api.Middleware;
|
||||
using Prospect.Server.Api.Services.Auth;
|
||||
using Prospect.Server.Api.Services.Auth.User;
|
||||
using Prospect.Server.Api.Services.Database;
|
||||
using Prospect.Server.Api.Services.UserData;
|
||||
using Serilog;
|
||||
|
||||
namespace Prospect.Server.Api
|
||||
namespace Prospect.Server.Api;
|
||||
|
||||
public class Startup
|
||||
{
|
||||
public class Startup
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
private IConfiguration Configuration { get; }
|
||||
private IConfiguration Configuration { get; }
|
||||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<AuthTokenSettings>(Configuration.GetSection(nameof(AuthTokenSettings)));
|
||||
services.Configure<DatabaseSettings>(Configuration.GetSection(nameof(DatabaseSettings)));
|
||||
services.Configure<PlayFabSettings>(Configuration.GetSection(nameof(PlayFabSettings)));
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<AuthTokenSettings>(Configuration.GetSection(nameof(AuthTokenSettings)));
|
||||
services.Configure<DatabaseSettings>(Configuration.GetSection(nameof(DatabaseSettings)));
|
||||
services.Configure<PlayFabSettings>(Configuration.GetSection(nameof(PlayFabSettings)));
|
||||
|
||||
services.AddSingleton<AuthTokenService>();
|
||||
services.AddSingleton<UserDataService>();
|
||||
services.AddSingleton<TitleDataService>();
|
||||
services.AddSingleton<AuthTokenService>();
|
||||
services.AddSingleton<UserDataService>();
|
||||
services.AddSingleton<TitleDataService>();
|
||||
|
||||
services.AddSingleton<DbUserService>();
|
||||
services.AddSingleton<DbEntityService>();
|
||||
services.AddSingleton<DbUserService>();
|
||||
services.AddSingleton<DbEntityService>();
|
||||
|
||||
services.AddSingleton<DbUserDataService>();
|
||||
services.AddSingleton<DbUserDataService>();
|
||||
|
||||
services.AddAuthentication(_ =>
|
||||
{
|
||||
services.AddAuthentication(_ =>
|
||||
{
|
||||
|
||||
})
|
||||
.AddUserAuthentication(_ => {})
|
||||
.AddEntityAuthentication(_ => {});
|
||||
})
|
||||
.AddUserAuthentication(_ => {})
|
||||
.AddEntityAuthentication(_ => {});
|
||||
|
||||
services.AddControllers().AddJsonOptions(options =>
|
||||
{
|
||||
options.JsonSerializerOptions.Converters.Add(new DateTimeConverter());
|
||||
});
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
services.AddControllers().AddJsonOptions(options =>
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseSerilogRequestLogging();
|
||||
app.UseMiddleware<RequestLoggerMiddleware>();
|
||||
app.UseRouting();
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
options.JsonSerializerOptions.Converters.Add(new DateTimeConverter());
|
||||
});
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseSerilogRequestLogging();
|
||||
app.UseMiddleware<RequestLoggerMiddleware>();
|
||||
app.UseRouting();
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user