'Declaration
<NotNullAttribute()> Public Overloads Shared Function Combine (Of TFirstValue,TResultValue)( _ ByVal first As ValueResult(Of TFirstValue), _ ByVal second As ValueResult, _ ByVal combineValuesFunction As Func(Of TFirstValue,Object,TResultValue) _ ) As ValueResult(Of TResultValue)
'Usage
Dim first As ValueResult(Of TFirstValue) Dim second As ValueResult Dim combineValuesFunction As Func(Of TFirstValue,Object,TResultValue) Dim value As ValueResult(Of TResultValue) value = ValueResult.Combine(Of TFirstValue, TResultValue)(first, second, combineValuesFunction)
[NotNull()] public static ValueResult<TResultValue> Combine<TFirstValue,TResultValue>( ValueResult<TFirstValue> first, ValueResult second, Func<TFirstValue,object,TResultValue> combineValuesFunction )
[NotNull()] public: static ValueResult<TResultValue^>^ Combinegeneric<typename TFirstValue> generic<typename TResultValue> ( ValueResult<TFirstValue^>^ first, ValueResult^ second, Func<TFirstValue^,Object^,TResultValue^>^ combineValuesFunction )
Parameters
- first
- The first value result.
- second
- The second value result.
- combineValuesFunction
- The function that combines the values of the first and second value result into a value of the resulting value result.
Type Parameters
- TFirstValue
- The type of value of the first value result.
- TResultValue
- The type of value of the resulting value result.
Return Value
If the first value result failed, returns failed value result made from the first value result. Otherwise, if the second value result failed, returns failed value result made from the second value result. Otherwise (i.e. when both the first and second value results succeeded), returns a success value result, containing a value returned by the combineValuesFunction for the values of the first and second value results.