Class BooleanResultExtensions
- Namespace
- Motiv
- Assembly
- Motiv.dll
Provides extension methods for working with enumerable collections.
public static class BooleanResultExtensions
- Inheritance
-
BooleanResultExtensions
- Inherited Members
Methods
AllFalse<TMetadata>(IEnumerable<BooleanResultBase<TMetadata>>)
Checks if all boolean results in a collection are false.
public static bool AllFalse<TMetadata>(this IEnumerable<BooleanResultBase<TMetadata>> results)
Parameters
resultsIEnumerable<BooleanResultBase<TMetadata>>The collection of BooleanResultBase<TMetadata> to check.
Returns
- bool
True if all boolean results are false, false otherwise.
Type Parameters
TMetadataThe specific type of metadata in the BooleanResultBase<TMetadata>.
AllTrue<TMetadata>(IEnumerable<BooleanResultBase<TMetadata>>)
Checks if all boolean results in a collection are true.
public static bool AllTrue<TMetadata>(this IEnumerable<BooleanResultBase<TMetadata>> results)
Parameters
resultsIEnumerable<BooleanResultBase<TMetadata>>The collection of BooleanResultBase<TMetadata> to check.
Returns
- bool
True if all boolean results are true, false otherwise.
Type Parameters
TMetadataThe specific type of metadata in the BooleanResultBase<TMetadata>.
AndAlsoTogether<TMetadata>(IEnumerable<BooleanResultBase<TMetadata>>)
Combines a collection of propositions using the conditional AND operator (i.e. &&).
public static BooleanResultBase<TMetadata> AndAlsoTogether<TMetadata>(this IEnumerable<BooleanResultBase<TMetadata>> booleanResults)
Parameters
booleanResultsIEnumerable<BooleanResultBase<TMetadata>>The boolean results to apply the AND operator to.
Returns
- BooleanResultBase<TMetadata>
A single boolean result that is the conditional AND of all the input boolean results.
Type Parameters
TMetadataThe type of the metadata.
AndTogether<TMetadata>(IEnumerable<BooleanResultBase<TMetadata>>)
Combines a collection of boolean results using the logical AND operator (i.e. &).
public static BooleanResultBase<TMetadata> AndTogether<TMetadata>(this IEnumerable<BooleanResultBase<TMetadata>> booleanResults)
Parameters
booleanResultsIEnumerable<BooleanResultBase<TMetadata>>The boolean results to apply the AND operator to.
Returns
- BooleanResultBase<TMetadata>
A single boolean result that is the logical AND of all the input boolean results.
Type Parameters
TMetadataThe type of the metadata.
AnyFalse<TMetadata>(IEnumerable<BooleanResultBase<TMetadata>>)
Checks if any boolean result in a collection are false.
public static bool AnyFalse<TMetadata>(this IEnumerable<BooleanResultBase<TMetadata>> results)
Parameters
resultsIEnumerable<BooleanResultBase<TMetadata>>The collection of BooleanResultBase<TMetadata> to check.
Returns
- bool
True if any boolean result is false, false otherwise.
Type Parameters
TMetadataThe specific type of metadata in the BooleanResultBase<TMetadata>.
AnyTrue<TMetadata>(IEnumerable<BooleanResultBase<TMetadata>>)
Checks if any boolean result in a collection are true.
public static bool AnyTrue<TMetadata>(this IEnumerable<BooleanResultBase<TMetadata>> results)
Parameters
resultsIEnumerable<BooleanResultBase<TMetadata>>The collection of BooleanResultBase<TMetadata> to check.
Returns
- bool
True if any boolean result is true, false otherwise.
Type Parameters
TMetadataThe specific type of metadata in the BooleanResultBase<TMetadata>.
CountFalse<TMetadata>(IEnumerable<BooleanResultBase<TMetadata>>)
Counts the number of boolean results in a collection where the result is false.
public static int CountFalse<TMetadata>(this IEnumerable<BooleanResultBase<TMetadata>> results)
Parameters
resultsIEnumerable<BooleanResultBase<TMetadata>>The collection of BooleanResultBase<TMetadata> to count.
Returns
- int
The count of boolean results where the result is false.
Type Parameters
TMetadataThe specific type of metadata used by BooleanResultBase<TMetadata>.
CountTrue<TMetadata>(IEnumerable<BooleanResultBase<TMetadata>>)
Counts the number of boolean results in a collection where the result is true.
public static int CountTrue<TMetadata>(this IEnumerable<BooleanResultBase<TMetadata>> results)
Parameters
resultsIEnumerable<BooleanResultBase<TMetadata>>The collection of BooleanResultBase<TMetadata> to count.
Returns
- int
The count of boolean results where the result is true.
Type Parameters
TMetadataThe specific type of metadata used by BooleanResultBase<TMetadata>.
OrElseTogether<TMetadata>(IEnumerable<BooleanResultBase<TMetadata>>)
Combines a collection of boolean results using the conditional OR operator (i.e. ||).
public static BooleanResultBase<TMetadata> OrElseTogether<TMetadata>(this IEnumerable<BooleanResultBase<TMetadata>> booleanResult)
Parameters
booleanResultIEnumerable<BooleanResultBase<TMetadata>>The boolean results to apply the OR operator to.
Returns
- BooleanResultBase<TMetadata>
A single boolean result that is the conditional OR of all the input propositions.
Type Parameters
TMetadataThe type of the metadata.
OrTogether<TMetadata>(IEnumerable<BooleanResultBase<TMetadata>>)
Combines a collection of boolean results using the logical OR operator (i.e. |).
public static BooleanResultBase<TMetadata> OrTogether<TMetadata>(this IEnumerable<BooleanResultBase<TMetadata>> booleanResult)
Parameters
booleanResultIEnumerable<BooleanResultBase<TMetadata>>The boolean results to apply the OR operator to.
Returns
- BooleanResultBase<TMetadata>
A single boolean result that is the logical OR of all the input propositions.
Type Parameters
TMetadataThe type of the metadata.
WhereFalse<TBooleanResult>(IEnumerable<TBooleanResult>)
Filters a collection of boolean results, returning only those where the result is false.
public static IEnumerable<TBooleanResult> WhereFalse<TBooleanResult>(this IEnumerable<TBooleanResult> results) where TBooleanResult : BooleanResultBase
Parameters
resultsIEnumerable<TBooleanResult>The collection of BooleanResultBase to filter.
Returns
- IEnumerable<TBooleanResult>
A collection of boolean results where the result is false.
Type Parameters
TBooleanResultThe specific type of BooleanResultBase in the collection.
WhereTrue<TBooleanResult>(IEnumerable<TBooleanResult>)
Filters a collection of boolean results, returning only those where the result is true.
public static IEnumerable<TBooleanResult> WhereTrue<TBooleanResult>(this IEnumerable<TBooleanResult> results) where TBooleanResult : BooleanResultBase
Parameters
resultsIEnumerable<TBooleanResult>The collection of BooleanResultBase to filter.
Returns
- IEnumerable<TBooleanResult>
A collection of boolean results where the result is true.
Type Parameters
TBooleanResultThe specific type of BooleanResultBase in the collection.