Is there a way we can prevent a method from being executed through aspects? #219
Unanswered
himanshukodwani
asked this question in
Q&A
Replies: 1 comment
-
Hi @himanshukodwani , [Advice(Kind.Around)]
public object CheckAccess(...){
//check access here
return null; // if check fails
} for more advanced scenarios you can take a look here https://github.com/pamidur/aspect-injector/blob/master/samples/UniversalWrapper/UniversalWrapper.cs Please let me know if it works for you? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What I need is an aspect that will check if the current user has permission to execute the method, if not, then I just want this aspect to prevent the method from being executed without throwing an exception and just returns some default value if required.
Beta Was this translation helpful? Give feedback.
All reactions