Call a method on every call

This may be a debugging / monitoring process.

I want to know a way, preferably in the best way, the method call each time other methods in the class / namespace / application are executed.

Snippets of code, opinions, and articles are rated.

+4
source share
2 answers

AOP; take a look at PostSharp, for example, which offers this type of weaving. Note that this approach works by iterating over the IL during the build process and may affect runtime performance when overused.

+6
source

Take a look at Aspect Oriented Programming (AOP). A good library for this Postsharp .

+1
source

Source: https://habr.com/ru/post/1384456/


All Articles