AOP 除了可以授权外还可以配置完整的日志
//注册ReZero.Api
builder.Services.AddReZeroServices(api =>
{
var apiObj = new SuperAPIOptions();
....省略....
//只看这一行
apiObj.InterfaceOptions.SuperApiAop=new MyAop();
api.EnableSuperApi(apiObj);
});
public class MyAop : DefaultSuperApiAop
{
public override Task OnExecutingAsync(InterfaceContext context)
{
return base.OnExecutingAsync(context);
}
public override Task OnExecutedAsync(InterfaceContext context)
{
return base.OnExecutedAsync(context);
}
public override Task OnErrorAsync(InterfaceContext context)
{
return base.OnErrorAsync(context);
}
}https://www.donet5.com/Doc/32/2638
2016 © donet5.comApache Licence 2.0