Class ConditionalObjectFactory<ObjectType>
Object factory which includes condition on the object creation
public class ConditionalObjectFactory<ObjectType> : ObjectFactory<ObjectType>, IObjectFactory, IConditionalObjectFactory where ObjectType : class, new()
Type Parameters
ObjectType
- Inheritance
-
objectObjectFactory<ObjectType>ConditionalObjectFactory<ObjectType>
- Implements
- Inherited Members
- Extension Methods
Properties
Conditions
Condition function which evaluates whether the object of the given type can be created based on the input data
protected List<IObjectCondition> Conditions { get; set; }
Property Value
- List<IObjectCondition>
Methods
CanCreateObject(object)
Returns true if the factory is able to create the object based on the given parameter
public override bool CanCreateObject(object parameter)
Parameters
parameter
objectObject parameter
Returns
- bool
WhenParameter<InputType>(Func<InputType, bool>)
Adds the object condition to the factory
public IConditionalObjectFactory WhenParameter<InputType>(Func<InputType, bool> condition)
Parameters
condition
Func<InputType, bool>Condition that must be matched
Returns
Type Parameters
InputType