Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Autofac registration helper: UsingLoggingInterceptor #162

Open
jbatte47 opened this issue Mar 24, 2014 · 0 comments
Open

New Autofac registration helper: UsingLoggingInterceptor #162

jbatte47 opened this issue Mar 24, 2014 · 0 comments
Milestone

Comments

@jbatte47
Copy link
Member

As a developer, I want a convenience method that allows me to write code like:

builder.RegisterInstance(new MyClass)
  .As<IMyContract>()
  .UsingLoggingInterceptor();

So that I don't have to write code like this anymore:

builder.RegisterInstance(new MyClass)
  .As<IMyContract>()
  .EnableInterfaceInterceptors()
  .InterceptedBy(typeof(LoggingInterceptor));

Bonus points: make it work for registered classes as well (detect scenario and call EnableClassInterceptors instead), and consider making the method generic, a la:

builder.RegisterInstance(new MyClass)
  .As<IMyContract>()
  .UsingInterceptor<LoggingInterceptor>();
@jbatte47 jbatte47 added this to the 3.12 milestone Apr 9, 2014
@jbatte47 jbatte47 modified the milestones: 4.1, 4.2 Aug 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant