-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
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
Do we need IAvoidDuplicateCrossCuttingConcerns
#15538
Comments
hi We will try to ignore the https://github.com/abpframework/abp/search?l=C%23&q=IsApplied |
Hi, We only apply for action/page filters and apply object is controller/page but we don't use interception for this types In this issue reason for apply to not check twice but we can use AsyncLocal public class NotifyOnExceptionInterceptor : AbpInterceptor, ITransientDependency
{
private static readonly AsyncLocal<bool> IsExecute = new AsyncLocal<bool>();
public NotifyOnExceptionInterceptor()
{
}
public override async Task InterceptAsync(IAbpMethodInvocation invocation)
{
if (IsExecute.Value)
{
await invocation.ProceedAsync();
return;
}
try
{
IsExecute.Value = true;
await invocation.ProceedAsync();
}
catch (Exception e)
{
//Log exception
throw;
}
}
} |
I think this won't work. Did you try that? |
Does it also work for multiple http requests? |
Yes every http requests different scope |
hi Can you open a pr? then I will test it. Thanks |
Hi @maliming Filter avoid object and interception target object is different that's why I think there is some confusion here BlogAdminAppService and BlogAdminController use same attributes(Authorize, RequiresFeature) in that case it check twice first action filter check after interception check(interception target object use BlogAdminAppService and action filter avoid object use BlogAdminController) If we want to check once then it must be like TenantAppService and TenantController(Authorize check only TenantAppService) In conclusion i think we can remove |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description
As far as I understand it controllers/pages don't use interceptions for performance issue but we're adding some unnecessary check
Analysis
As you notice apply method take object as parameter to avoid duplicate CCC and we give controller/page for that also we only use with filters but filters object(Controller/Page) never intercept by AbpInterception
The text was updated successfully, but these errors were encountered: