Class RegistrationExtensions
- Namespace
- NRules.Integration.Autofac
- Assembly
- NRules.Integration.Autofac.dll
Extension methods on Autofac.ContainerBuilder to register NRules components with Autofac container.
public static class RegistrationExtensions
- Inheritance
-
RegistrationExtensions
- Inherited Members
Methods
RegisterRuleRepository(ContainerBuilder, Action<IRuleTypeScanner>)
Registers fluent rule types with the container, registers RuleRepository with the container and loads registered rules into the repository. By default repository is registered as a single instance and is wired with a IRuleActivator.
public static IRegistrationBuilder<RuleRepository, ConcreteReflectionActivatorData, SingleRegistrationStyle> RegisterRuleRepository(this ContainerBuilder builder, Action<IRuleTypeScanner> scanAction)
Parameters
builder
ContainerBuilderContainer builder.
scanAction
Action<IRuleTypeScanner>Configuration action on the rule type scanner.
Returns
- IRegistrationBuilder<RuleRepository, ConcreteReflectionActivatorData, SingleRegistrationStyle>
Registration builder for RuleRepository to specify additional registration configuration.
RegisterSession(ContainerBuilder)
Registers ISession with the container. By default session is registered as an instance per lifetime scope.
public static IRegistrationBuilder<ISession, SimpleActivatorData, SingleRegistrationStyle> RegisterSession(this ContainerBuilder builder)
Parameters
builder
ContainerBuilderContainer builder.
Returns
- IRegistrationBuilder<ISession, SimpleActivatorData, SingleRegistrationStyle>
Registration builder for ISession to specify additional registration configuration.
RegisterSession(ContainerBuilder, Func<IComponentContext, ISession>)
Registers ISession with the container. By default session is registered as an instance per lifetime scope.
public static IRegistrationBuilder<ISession, SimpleActivatorData, SingleRegistrationStyle> RegisterSession(this ContainerBuilder builder, Func<IComponentContext, ISession> factoryFunc)
Parameters
builder
ContainerBuilderContainer builder.
factoryFunc
Func<IComponentContext, ISession>Factory function that creates an instance of ISession.
Returns
- IRegistrationBuilder<ISession, SimpleActivatorData, SingleRegistrationStyle>
Registration builder for ISession to specify additional registration configuration.
RegisterSessionFactory(ContainerBuilder)
Registers ISessionFactory with the container. Requires that IRuleRepository is registered with the container. By default session factory is registered as a single instance and is wired with a IDependencyResolver.
public static IRegistrationBuilder<ISessionFactory, SimpleActivatorData, SingleRegistrationStyle> RegisterSessionFactory(this ContainerBuilder builder)
Parameters
builder
ContainerBuilderContainer builder.
Returns
- IRegistrationBuilder<ISessionFactory, SimpleActivatorData, SingleRegistrationStyle>
Registration builder for ISessionFactory to specify additional registration configuration.
RegisterSessionFactory(ContainerBuilder, Func<IComponentContext, ISessionFactory>)
Registers ISessionFactory with the container. By default session factory is registered as a single instance and is wired with a IDependencyResolver.
public static IRegistrationBuilder<ISessionFactory, SimpleActivatorData, SingleRegistrationStyle> RegisterSessionFactory(this ContainerBuilder builder, Func<IComponentContext, ISessionFactory> compileFunc)
Parameters
builder
ContainerBuilderContainer builder.
compileFunc
Func<IComponentContext, ISessionFactory>Compile function that creates an instance of ISessionFactory.
Returns
- IRegistrationBuilder<ISessionFactory, SimpleActivatorData, SingleRegistrationStyle>
Registration builder for ISessionFactory to specify additional registration configuration.