AspectLib — A Set of AOP Helpers for .NET (Built on MrAdvice) #217
kalebakeits
started this conversation in
Show and tell
Replies: 2 comments
|
Cool idea. Thanks for sharing! But I see some potential problems - what if you have other service with same method name? Would be better to accept cache Key in attribute constructor (or at least built key with class name). Also hardcoded 30 min, should be a attribute param really. But I really like it, thanks! |
0 replies
|
Nice ! That’s a good use of aspect programming (and also, we use internally the same advices 😉) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone! I built a class library based on MrAdvice called AspectLib. While using MrAdvice in a project to build a simple caching aspect, it sparked a few ideas for other AOP helpers I’d find useful. Decided to turn it into a small library in case anyone else finds it helpful too.
Example usage:
Without
[Cache]the equivalent code would be:Planned Aspect
[Log]- log method entries, exits, and optionally execution time.[Retry]- retrying operations when certain exceptions are thrown, avoiding verbose retry loops scattered in code.Open to feedback or contributions if anyone’s interested.
All reactions