Ejemplo n.º 1
0
 public static OperationResult <TResult> Combine <T1, T2, TResult>(OperationResult <T1> operationResult1, OperationResult <T2> operationResult2, Func <T1, T2, TResult> combiner)
 => operationResult1.AssertNotNull(nameof(operationResult1)).IsFailure ? OperationResult <TResult> .FromError(operationResult1.Error)
         : operationResult2.AssertNotNull(nameof(operationResult2)).IsFailure ? OperationResult <TResult> .FromError(operationResult2.Error)
         : OperationResult <TResult> .FromResult(combiner.AssertNotNull(nameof(combiner)).Invoke(operationResult1.Value, operationResult2.Value));