Skip to content

Commit

Permalink
fix: 处理编译器警告. (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
joesdu authored Jun 27, 2024
2 parents f14379f + 8b830d3 commit 0607bf7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sample/WebApi.Test.Unit/AppWebModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ public override void ApplicationInitialization(ApplicationContext context)
base.ApplicationInitialization(context);
var app = context.GetApplicationHost() as IApplicationBuilder;
// 全局异常处理中间件
app.UseExceptionHandler();
app.UseResponseTime();
app?.UseExceptionHandler();
app?.UseResponseTime();
// 先认证
app.UseAuthentication();
app?.UseAuthentication();
// 再授权
app.UseAuthorization();
app?.UseAuthorization();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace EasilyNET.AutoDependencyInjection.Contexts;
/// 自定义配置服务上下文
/// </summary>
/// <param name="services"></param>
/// <param name="provider"></param>
public sealed class ConfigureServicesContext(IServiceCollection services, IServiceProvider? provider)
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ protected void SetServiceProvider(IServiceProvider serviceProvider)

protected void InitializeModules()
{
ArgumentNullException.ThrowIfNull(ServiceProvider, nameof(ServiceProvider));
using var scope = ServiceProvider.CreateScope();
var ctx = new ApplicationContext(scope.ServiceProvider);
foreach (var cfg in Modules) cfg.ApplicationInitialization(ctx);
Expand Down

0 comments on commit 0607bf7

Please sign in to comment.