Clone this wiki locally
Autofac takes a slightly different approach for registering types, by providing the concrete type as the first parameter. The registration is done on the
RegisterType<T>- registers a concrete type T
RegisterType(typeof(Type))- non generic version
Register(c => new Foo(c.Resolve<IBar>()))- register with lambda expression (only the
new Foo()is inspected)
- More complex registrations, see this for example.
RegisterAssemblyTypes(params Assembly)- the following parameters are currently supported:
ThisAssemblyproperty - only available when called within an Autofac Module
The following filters can be applied in convention-based registration:
As<T>- can be applied several times
As(params Type)- currently supports
Not (yet?) supported
- Did I miss something? Let me know about it!