using Microsoft.AspNetCore.Http;
namespace Falcon.Middleware.Test
{
///
/// 测试中间件
///
public class MiddlewareTest:MiddlewareBase
{
public MiddlewareTest(RequestDelegate next) : base(next) {
}
///
/// 在调用next之后执行
///
/// 请求上下文
public async override void InvokeNextAfter(HttpContext context) {
await context.Response.WriteAsync("\nInvokeNextAfter");
}
///
/// 在调用next之前执行
///
/// 请求上下文
public async override void InvokeNextBefore(HttpContext context) {
await context.Response.WriteAsync("InvokeNextBefore\n");
}
}
}