pamidur / aspect-injector

AOP framework for .NET (c#, vb, etc)
Apache License 2.0
745 stars 112 forks source link

Allowed injections to be inherited by deriving attributes #122

Closed pamidur closed 4 years ago

pamidur commented 4 years ago

This PR allows injections to be inherited.

so you can do something like:

    [Injection(typeof(CacheAspect), Inherited=true)]
    public abstract class CacheAttribute : Attribute
    {
        public abstract ObjectCache Cache { get; }
        public abstract CacheItemPolicy Policy { get; }
    }

    public class MemoryCacheAttribute : CacheAttribute
    {
         ... implementation
    }

And then MemoryCacheAttribute will behave as if it has [Injection(typeof(CacheAspect))]