protected override void RegisterNancyEnvironment(ITenantContainerAdaptor container, INancyEnvironment environment) { container.Configure((services) => { services.AddSingleton <INancyEnvironment>(environment); }); }
protected override void RegisterBootstrapperTypes(ITenantContainerAdaptor applicationContainer) { applicationContainer.Configure((services) => { services.AddSingleton <INancyModuleCatalog>(this); services.AddSingleton <IFileSystemReader, DefaultFileSystemReader>(); }); }
protected override void RegisterRequestContainerModules(ITenantContainerAdaptor container, IEnumerable <ModuleRegistration> moduleRegistrationTypes) { container.Configure((services) => { foreach (var registrationType in moduleRegistrationTypes) { services.AddTransient(typeof(INancyModule), registrationType.ModuleType); } }); }
protected override void RegisterInstances(ITenantContainerAdaptor container, IEnumerable <InstanceRegistration> instanceRegistrations) { container.Configure((services) => { foreach (var instanceRegistration in instanceRegistrations) { services.AddSingleton(instanceRegistration.RegistrationType, instanceRegistration.Implementation); } }); }
protected override void RegisterTypes(ITenantContainerAdaptor container, IEnumerable <TypeRegistration> typeRegistrations) { container.Configure((services) => { foreach (var typeRegistration in typeRegistrations) { RegisterType( typeRegistration.RegistrationType, typeRegistration.ImplementationType, container.Role == ContainerRole.Scoped ? Lifetime.PerRequest : typeRegistration.Lifetime, services); } }); }