Class PolicyExtensions
- Namespace
- Motiv
- Assembly
- Motiv.dll
Extension methods for Policy<TModel, TMetadata>.
public static class PolicyExtensions
- Inheritance
-
PolicyExtensions
- Inherited Members
Methods
OrElseTogether<TModel, TMetadata>(IEnumerable<PolicyBase<TModel, TMetadata>>)
Combines a collection of PolicyBase<TModel, TMetadata> whereby the enumeration of the policies halts at the first policy that is satisfied. If no policies are satisfied, the last policy's false metadata is returned. This is equivalent to combining the policies using the OrElse(PolicyBase<TModel, TMetadata>) method.
public static PolicyBase<TModel, TMetadata> OrElseTogether<TModel, TMetadata>(this IEnumerable<PolicyBase<TModel, TMetadata>> propositions)
Parameters
propositionsIEnumerable<PolicyBase<TModel, TMetadata>>The propositions to apply the ELSE operator to.
Returns
- PolicyBase<TModel, TMetadata>
A single specification that represents the conditional OR of all the input propositions.
Type Parameters
TModelThe type of the model.
TMetadataThe type of the metadata.