Table of Contents

Class ConditionalObjectFactory<ObjectType>

Namespace
CMS.Base
Assembly
CMS.Base.dll

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
object
ObjectFactory<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 object

Object 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

IConditionalObjectFactory

Type Parameters

InputType