Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 处理编译器警告. #476

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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