Class ResultEnumerableExtensions
public static class ResultEnumerableExtensions
- Inheritance
-
ResultEnumerableExtensions
- Inherited Members
Methods
GetProblems(IEnumerable<Result>)
Retrieves all problems from the results in the collection.
public static IEnumerable<ResultProblem> GetProblems(this IEnumerable<Result> results)
Parameters
resultsIEnumerable<Result>The collection of Result objects.
Returns
- IEnumerable<ResultProblem>
An IEnumerable<T> of ResultProblem objects from the failed results.
GetProblems<T>(IEnumerable<Result<T>>)
Retrieves all problems from the results in the collection.
public static IEnumerable<ResultProblem> GetProblems<T>(this IEnumerable<Result<T>> results)
Parameters
resultsIEnumerable<Result<T>>The collection of Result<T> objects.
Returns
- IEnumerable<ResultProblem>
An IEnumerable<T> of ResultProblem objects from the failed results.
Type Parameters
TThe type of the result value.
GetValues<T>(IEnumerable<Result<T>>)
Retrieves all successful result values from the collection.
public static IEnumerable<T> GetValues<T>(this IEnumerable<Result<T>> results)
Parameters
resultsIEnumerable<Result<T>>The collection of Result<T> objects.
Returns
- IEnumerable<T>
An IEnumerable<T> of successful result values.
Type Parameters
TThe type of the result value.
HasProblems(IEnumerable<Result>)
Determines whether any of the results in the collection indicate failure.
public static bool HasProblems(this IEnumerable<Result> results)
Parameters
resultsIEnumerable<Result>The collection of Result objects.
Returns
- bool
trueif any result in the collection failed; otherwise,false.
HasProblems<T>(IEnumerable<Result<T>>)
Determines whether any of the results in the collection indicate failure.
public static bool HasProblems<T>(this IEnumerable<Result<T>> results)
Parameters
resultsIEnumerable<Result<T>>The collection of Result<T> objects.
Returns
- bool
trueif any result in the collection failed; otherwise,false.
Type Parameters
TThe type of the result value.
TryPickProblems(IEnumerable<Result>, out ResultProblemCollection?)
Attempts to collect problems from the results in the collection.
public static bool TryPickProblems(this IEnumerable<Result> results, out ResultProblemCollection? problems)
Parameters
resultsIEnumerable<Result>The collection of Result objects.
problemsResultProblemCollectionWhen this method returns, contains a ResultProblemCollection that includes all problems found in the failed results. If the collection had no problems, this parameter is set to
null.
Returns
- bool
trueif any result in the collection had problems; otherwise,false.
TryPickProblems<T>(IEnumerable<Result<T>>, out ResultProblemCollection?)
Attempts to collect problems from the results in the collection.
public static bool TryPickProblems<T>(this IEnumerable<Result<T>> results, out ResultProblemCollection? problems)
Parameters
resultsIEnumerable<Result<T>>The collection of Result<T> objects.
problemsResultProblemCollectionWhen this method returns, contains a ResultProblemCollection that includes all problems found in the failed results. If the collection had no problems, this parameter is set to
null.
Returns
- bool
trueif any result in the collection had problems; otherwise,false.
Type Parameters
TThe type of the result value.
TryPickProblems<T>(IEnumerable<Result<T>>, out ResultProblemCollection?, out IList<T>?)
Attempts to collect problems and successful values from the results in the collection.
public static bool TryPickProblems<T>(this IEnumerable<Result<T>> results, out ResultProblemCollection? problems, out IList<T>? values)
Parameters
resultsIEnumerable<Result<T>>The collection of Result<T> objects.
problemsResultProblemCollectionWhen this method returns, contains a ResultProblemCollection that includes all problems found in the failed results. If the collection had no problems, this parameter is set to
null.valuesIList<T>When this method returns, contains a collection of successful result values. If no results were successful, this parameter is set to
null.
Returns
- bool
trueif any result in the collection had problems; otherwise,false.
Type Parameters
TThe type of the result value.