How AOP works with PostSharp
You add the PostSharp package to your project. Then, you annotate your code with attributes. The C# compiler builds your code into binary, and then PostSharp analyzes the binary and injects the implementation of aspects. Although binaries are modified with injected code at compile time, your project’s source code remains unaltered. This means you can keep your code nice, clean, and simple, which in turn makes maintenance, reuse, and extending existing code bases much easier in the long term.
PostSharp has some really good ready-made patterns for you to utilize. These cover Model-View-ViewModel (MVVM), caching, multithreading, logging and architecture validation, and more. But the good news is that if none of these meets your requirements, then you can automate your own patterns by extending the aspect framework and/or the architecture framework.
With the aspect framework, you develop your simple or composite aspect, apply it to the code, and...