You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
643 B

using CoreAgent.Infrastructure.Middleware.GlobalException;
using Microsoft.AspNetCore.Builder;
namespace CoreAgent.Infrastructure.Middleware.GlobalException;
/// <summary>
/// 全局异常中间件扩展方法
/// </summary>
public static class GlobalExceptionMiddlewareExtensions
{
/// <summary>
/// 使用全局异常处理中间件
/// </summary>
/// <param name="app">应用程序构建器</param>
/// <returns>应用程序构建器</returns>
public static IApplicationBuilder UseGlobalExceptionMiddleware(this IApplicationBuilder app)
{
return app.UseMiddleware<GlobalExceptionMiddleware>();
}
}