简体   繁体   中英

Autofac: Get registration created by scanning

I saw a couple of similar questions but no exact answer.

If I scan an assembly:

containerBuilder.RegisterAssemblyTypes(...)

Can I then tweak the registration of a specific type that was registered this way?, ie:

containerBuilder.RegisterAssemblyTypes(...)
containerBuilder.GetRegistration<MyType>().WithParameter("param", paramValue);

Is there a way to achieve something of this sort with Autofac?

You can use Except() method to exclude types from scanning, then you can register your special types by hand. More info on Autofac wiki .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM