We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我通过 invocation.ReturnValue来获得和返回原始方法的值,但好像不行 代码如下:
[AttributeUsage(AttributeTargets.Method,Inherited = true)] public class AutoCacheAbleAttribute : AspectPointAttribute { public override async Task OnInvocation(AspectContext aspectContext, AspectDelegate _next) { ...... ...... var cacheValue = await ProcessGetAsync(invocation, methodInfo, returnType); //如果缓存存在,则直接返回 if (cacheValue != null) { invocation.ReturnValue = cacheValue; return; } //执行原方法 await _next(aspectContext); //缓存方法结果 await ProcessPutAsync(invocation, methodInfo, returnType, invocation.ReturnValue ); } }
我看了源代码。 在AopIntercept.cs里,方法的返回值是通过 aspectContext.Result 来传递,但是aspectContext.Result是internal的外部程序集是访问不到。 请问该如何处理。
The text was updated successfully, but these errors were encountered:
我看看
Sorry, something went wrong.
8e8f9b3
我提交了新版。你拿新版 好像代码都不用动,应该就可以实现你的想法。 也 可以看下 单元测试 8e8f9b3
多谢!! 经过测试,OK了
No branches or pull requests
我通过 invocation.ReturnValue来获得和返回原始方法的值,但好像不行
代码如下:
我看了源代码。
在AopIntercept.cs里,方法的返回值是通过 aspectContext.Result 来传递,但是aspectContext.Result是internal的外部程序集是访问不到。
请问该如何处理。
The text was updated successfully, but these errors were encountered: