I previously wrote on the difficulties of Aspect-Orientation in C#. The addition of Source Generators in C# 9 changes the possibilities considerably.
I’ve been unhappy with the async/background work model in my system for a while. The async logic always seems excessively complex, either entangled with business logic or creating opaque coupling between flows. However, my recent breakthrough on code structure suggested a clear path to adding background work in an aspect-oriented style. Let’s examine a refactor that helped me prove decorator-style async communication.