Releases: iQuarc/AppBoot
Releases · iQuarc/AppBoot
Add support for registrations by convention
iQuarc.AppBoot 1.1.0.nupkg available on nuget.org
Registrations into the Dependency Injection Container may also be done by conventions, through the new ConventionRegistrationBehavior
.
var conventions = new ConventionRegistrationBehavior();
conventions.ForTypesDerivedFrom<Repository>().ExportInterfaces(x => x.Name.EndsWith("Repository"));
conventions.ForType<InterceptorsResolver>().Export(b => b.AsContractType<IInterceptorsResolver>().WithLifetime(Lifetime.Application));
conventions.ForType<UnitOfWork>().Export(b => b.AsContractType<IUnitOfWork>());
Bootstrapper b = new Bootstrapper(assemblies);
b.AddRegistrationBehavior(conventions);
...