Class DeletionResultExtensions
Extension methods for DeletionResult.
public static class DeletionResultExtensions
- Inheritance
-
DeletionResultExtensions
- Inherited Members
Methods
MapToResult(DeletionResult, bool)
Converts a DeletionResult to a Result, optionally treating not-found as success.
public static Result MapToResult(this DeletionResult result, bool allowNotFound = true)
Parameters
resultDeletionResultThe deletion result to convert.
allowNotFoundboolIf true, not-found is treated as success. If false, not-found is treated as failure.
Returns
Match<T>(DeletionResult, Func<T>, Func<T>, Func<ResultProblemCollection, T>)
Exhaustively matches over the three states of a DeletionResult.
public static T Match<T>(this DeletionResult result, Func<T> onSuccess, Func<T> onNotFound, Func<ResultProblemCollection, T> onProblems)
Parameters
resultDeletionResultThe deletion result to match.
onSuccessFunc<T>Called when the deletion succeeded.
onNotFoundFunc<T>Called when the entity was not found.
onProblemsFunc<ResultProblemCollection, T>Called when the deletion failed with problems.
Returns
- T
The value produced by the matched handler.
Type Parameters
TThe return type.