Class RuleActivator
- Namespace
- NRules.Integration.DependencyInjection
- Assembly
- NRules.Integration.DependencyInjection.dll
Rule activator that uses .NET DI container.
public class RuleActivator : IRuleActivator
- Inheritance
-
RuleActivator
- Implements
- Inherited Members
Constructors
RuleActivator(IServiceProvider)
Creates a rule activator that uses the specified service provider.
public RuleActivator(IServiceProvider serviceProvider)
Parameters
serviceProvider
IServiceProviderService provider to use to create rule instances.
Methods
Activate(Type)
Creates rule's instances from a CLR type.
public IEnumerable<Rule> Activate(Type type)
Parameters
type
TypeRule CLR type.
Returns
- IEnumerable<Rule>
Rule instances.
Remarks
The same rule type may be instantiated multiple times with different parameters. Each instance is considered a separate rule, and should have a unique name.