Configure ASP.NET for the API to work #7
@ -42,7 +42,8 @@ public class Program
|
|||||||
builder.Configuration.AddConfiguration(ConfigureEnvironment());
|
builder.Configuration.AddConfiguration(ConfigureEnvironment());
|
||||||
builder.Configuration.AddJsonFile(Settings.FilePath, optional: true, reloadOnChange: true);
|
builder.Configuration.AddJsonFile(Settings.FilePath, optional: true, reloadOnChange: true);
|
||||||
|
|
||||||
// Add services to the container.
|
builder.Services.AddApplication();
|
||||||
|
builder.Services.AddPersistence(builder.Configuration);
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
|
|
||||||
builder.Services.AddCors(options =>
|
builder.Services.AddCors(options =>
|
||||||
@ -89,6 +90,10 @@ public class Program
|
|||||||
foreach (var item in app.Configuration.AsEnumerable())
|
foreach (var item in app.Configuration.AsEnumerable())
|
||||||
Console.WriteLine($"{item.Key}:{item.Value}");
|
Console.WriteLine($"{item.Key}:{item.Value}");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
var uber = app.Services.CreateScope().ServiceProvider.GetService<UberDbContext>();
|
||||||
|
DbInitializer.Initialize(uber!);
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
if (app.Environment.IsDevelopment())
|
if (app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user