Skip to content

Commit 6c78465

Browse files
committed
feat: add WarmupDbContext
1 parent 7a91115 commit 6c78465

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/Netcorext.Auth.API/InjectionConfigs/AppConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Netcorext.Auth.API.Services.Role;
88
using Netcorext.Auth.API.Services.User;
99
using Netcorext.Auth.API.Settings;
10+
using Netcorext.EntityFramework.UserIdentityPattern.AspNetCore;
1011
using Netcorext.Extensions.AspNetCore.Middlewares;
1112
using Netcorext.Logging.AspNetCoreLogger;
1213

@@ -65,6 +66,8 @@ public AppConfig(WebApplication app)
6566
registerConfig.RouteServiceUrl = config.Services["Netcorext.Auth.Gateway"].Url;
6667
});
6768

69+
app.Lifetime.ApplicationStarted.Register(app.WarmupDbContext);
70+
6871
app.Run();
6972
}
7073
}

src/Netcorext.Auth.Authentication/InjectionConfigs/AppConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Netcorext.Auth.Authentication.Services.Permission;
44
using Netcorext.Auth.Authentication.Services.Token;
55
using Netcorext.Auth.Authentication.Settings;
6+
using Netcorext.EntityFramework.UserIdentityPattern.AspNetCore;
67
using Netcorext.Extensions.AspNetCore.Middlewares;
78
using Netcorext.Logging.AspNetCoreLogger;
89

@@ -50,6 +51,8 @@ public AppConfig(WebApplication app)
5051
app.MapGrpcService<TokenValidationServiceFacade>();
5152
app.MapReverseProxy();
5253

54+
app.Lifetime.ApplicationStarted.Register(app.WarmupDbContext);
55+
5356
app.Run();
5457
}
5558
}

src/Netcorext.Auth.Authorization/InjectionConfigs/AppConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Microsoft.Extensions.Options;
33
using Netcorext.Auth.Authorization.Services.Authorization;
44
using Netcorext.Auth.Authorization.Settings;
5+
using Netcorext.EntityFramework.UserIdentityPattern.AspNetCore;
56
using Netcorext.Extensions.AspNetCore.Middlewares;
67
using Netcorext.Logging.AspNetCoreLogger;
78

@@ -56,6 +57,8 @@ public AppConfig(WebApplication app)
5657
registerConfig.RouteServiceUrl = config.Services["Netcorext.Auth.Gateway"].Url;
5758
});
5859

60+
app.Lifetime.ApplicationStarted.Register(app.WarmupDbContext);
61+
5962
app.Run();
6063
}
6164
}

src/Netcorext.Auth.Gateway/InjectionConfigs/AppConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Microsoft.Extensions.Options;
22
using Netcorext.Auth.Gateway.Services.Route;
33
using Netcorext.Auth.Gateway.Settings;
4+
using Netcorext.EntityFramework.UserIdentityPattern.AspNetCore;
45
using Netcorext.Extensions.AspNetCore.Middlewares;
56
using Netcorext.Logging.AspNetCoreLogger;
67

@@ -47,6 +48,8 @@ public AppConfig(WebApplication app)
4748

4849
app.MapReverseProxy();
4950

51+
app.Lifetime.ApplicationStarted.Register(app.WarmupDbContext);
52+
5053
app.Run();
5154
}
5255
}

0 commit comments

Comments
 (0)