Ran formatting through code
This commit is contained in:
@ -1,47 +1,53 @@
|
||||
using ReportingServices.Shared.Repositories;
|
||||
using Serilog;
|
||||
|
||||
LoggerConfiguration loggerConfiguration = new();
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
Environment.SetEnvironmentVariable("workingDirectory", "D:\\tmp\\logging\\MesaReportingServices\\API");
|
||||
_ = ConfigurationLoggerConfigurationExtensions.Configuration(loggerConfiguration.ReadFrom, builder.Configuration);
|
||||
_ = SerilogHostBuilderExtensions.UseSerilog(builder.Host);
|
||||
Log.Logger = loggerConfiguration.CreateLogger();
|
||||
Serilog.ILogger log = Log.ForContext<Program>();
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddScoped<IScrapeDatabaseRepository, ScrapeDatabaseRepository>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
internal class Program
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
LoggerConfiguration loggerConfiguration = new();
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||
Environment.SetEnvironmentVariable("workingDirectory", "D:\\tmp\\logging\\MesaReportingServices\\API");
|
||||
_ = loggerConfiguration.ReadFrom.Configuration(builder.Configuration);
|
||||
_ = builder.Host.UseSerilog();
|
||||
Log.Logger = loggerConfiguration.CreateLogger();
|
||||
Serilog.ILogger log = Log.ForContext<Program>();
|
||||
// Add services to the container.
|
||||
_ = builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
_ = builder.Services.AddEndpointsApiExplorer();
|
||||
_ = builder.Services.AddSwaggerGen();
|
||||
_ = builder.Services.AddScoped<IScrapeDatabaseRepository, ScrapeDatabaseRepository>();
|
||||
|
||||
app.UseAuthorization();
|
||||
WebApplication app = builder.Build();
|
||||
|
||||
app.MapControllers();
|
||||
_ = app.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
|
||||
log.Information("Starting Web APIs");
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
_ = app.UseSwagger();
|
||||
_ = app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
app.Run();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Fatal(ex, "Host terminated unexpectedly");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Log.CloseAndFlush();
|
||||
}
|
||||
_ = app.UseHttpsRedirection();
|
||||
|
||||
_ = app.UseAuthorization();
|
||||
|
||||
_ = app.MapControllers();
|
||||
_ = app.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
|
||||
log.Information("Starting Web APIs");
|
||||
|
||||
try
|
||||
{
|
||||
app.Run();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Fatal(ex, "Host terminated unexpectedly");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Log.CloseAndFlush();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user