110,499
社区成员
发帖
与我相关
我的任务
分享
public static RequestDelegate AAAMiddleware(RequestDelegate next){
return new RequestDelegate (context=>{context.Response.WriteAsync("Foo=>");});
}
然后,AAAMiddleware只有一行返回,可以把{}去掉,同样匿名函数也只有一行返回,也可以去掉{},再进一步简化就是这样了:
public static RequestDelegate AAAMiddleware(RequestDelegate next)
=> context=>context.Response.WriteAsync("Foo=>");
[/quote]
///这一步还好我能直接看懂,没啥问题,就是下面这一个
public static RequestDelegate AAAMiddleware(RequestDelegate next){
return new RequestDelegate (context=>{context.Response.WriteAsync("Foo=>");});
}
//这一步就有点懵了
public static RequestDelegate AAAMiddleware(RequestDelegate next)
=> context=>context.Response.WriteAsync("Foo=>");
public static RequestDelegate AAAMiddleware(RequestDelegate next){
return new RequestDelegate (context=>{context.Response.WriteAsync("Foo=>");});
}
public static RequestDelegate AAAMiddleware(RequestDelegate next)
=> context=>context.Response.WriteAsync("Foo=>");