-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
26 lines (16 loc) · 758 Bytes
/
Program.cs
File metadata and controls
26 lines (16 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using Microsoft.EntityFrameworkCore;
using RoutingSlipLostVariable.StateMachines.DbContexts;
using RoutingSlipLostVariable.StateMachines.Extensions;
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddStateMachine(builder.Configuration);
WebApplication app = builder.Build();
// Configure the HTTP request pipeline.
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
using IServiceScope scope = app.Services.CreateScope();
await using ClaimRewardDbContext dbContext = scope.ServiceProvider.GetRequiredService<ClaimRewardDbContext>();
await dbContext.Database.MigrateAsync();
await app.RunAsync();