autofac / Autofac.Extras.DynamicProxy

Interceptor and decorator support for Autofac IoC via Castle DynamicProxy
MIT License
106 stars 33 forks source link

Allow InterceptAttribute to be a non sealed class #13

Closed prainho closed 8 years ago

prainho commented 8 years ago

I would like to have something like this:

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] public class AuditAttribute : InterceptAttribute { public AuditAttribute() :base(typeof(AuditInterceptor)) { } }

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] public class LogAttribute : InterceptAttribute { public LogAttribute() :base(typeof(LogInterceptor)) { } }

And using it like this :

[Audit] [Log] public class MyClass

It's much better and simpler than having this:

[Intercept(typeof(AuditInterceptor))] [Intercept(typeof(LogInterceptor))] public class MyClass

But for me to do that I need the class InterceptAttribute to be a non sealed class. The non sealed class would have big advantages compared to the sealed class.

Thanks

tillig commented 8 years ago

I think we can do that, sure.

tillig commented 8 years ago

Resolved by https://github.com/autofac/Autofac.Extras.DynamicProxy/commit/7863ac0fba2d33982abde6592cee9f9f8e336843

tillig commented 8 years ago

This will go out as 4.1.0.