Exemplo n.º 1
0
 protected override void RegisterNancyEnvironment(ITenantContainerAdaptor container, INancyEnvironment environment)
 {
     container.Configure((services) =>
     {
         services.AddSingleton <INancyEnvironment>(environment);
     });
 }
Exemplo n.º 2
0
 protected override void RegisterBootstrapperTypes(ITenantContainerAdaptor applicationContainer)
 {
     applicationContainer.Configure((services) =>
     {
         services.AddSingleton <INancyModuleCatalog>(this);
         services.AddSingleton <IFileSystemReader, DefaultFileSystemReader>();
     });
 }
Exemplo n.º 3
0
 protected override void RegisterRequestContainerModules(ITenantContainerAdaptor container, IEnumerable <ModuleRegistration> moduleRegistrationTypes)
 {
     container.Configure((services) =>
     {
         foreach (var registrationType in moduleRegistrationTypes)
         {
             services.AddTransient(typeof(INancyModule), registrationType.ModuleType);
         }
     });
 }
Exemplo n.º 4
0
 protected override void RegisterInstances(ITenantContainerAdaptor container, IEnumerable <InstanceRegistration> instanceRegistrations)
 {
     container.Configure((services) =>
     {
         foreach (var instanceRegistration in instanceRegistrations)
         {
             services.AddSingleton(instanceRegistration.RegistrationType, instanceRegistration.Implementation);
         }
     });
 }
Exemplo n.º 5
0
 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);
         }
     });
 }