Suppose there is some class and before calling some methods I want to call another method.
For example, I want to check the privileges for this operation.
Yes, I can add a function to each method that will do this.
But can it be done in another way?
Suppose there is some class and before calling some methods I want to call another method.
For example, I want to check the privileges for this operation.
Yes, I can add a function to each method that will do this.
But can it be done in another way?
You can use either PostSharp or do it yourself using the “ Intercepting method calls in C #, an approach to AOSD ” guide .
Source: https://ru.stackoverflow.com/questions/588547/
All Articles