zcz527 / autofac

Automatically exported from code.google.com/p/autofac
Other
0 stars 0 forks source link

Feature Request: Add AsSelf() and AsImplementedInterfaces() for simple registrations #257

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When registering types with RegisterAssemblyTypes(), one can use AsSelf() and 
AsImplementedInterfaces() like this:

builder.RegisterAssemblyTypes(assemblies).AsSelf().AsImplementedInterfaces();

... which is awesome. But when registering a single type like this:

builder.Register(c => new 
Foo(c.Resolve<Bar>())).AsSelf().AsImplementedInterfaces();

does not compile. It would be nice to have overloads for AsSelf() and 
AsImplementedInterfaces() on simple registrations as well because it allows 
these registrations to be less redundant.

Original issue reported on code.google.com by jim.bolla on 31 Aug 2010 at 2:05

GoogleCodeExporter commented 8 years ago
Thanks for the suggestion - we've already implemented this one a little while 
ago; you can kick the tyres in the 2.3 preview build available on the downloads 
page. Cheers,
Nick

Original comment by nicholas...@gmail.com on 31 Aug 2010 at 10:29