CSharpFunctionalExtensions icon indicating copy to clipboard operation
CSharpFunctionalExtensions copied to clipboard

Result.Combine question

Open macpak opened this issue 2 years ago • 2 comments

Hi,

Is there a way to use Combine in such a way that a result of Combine contains valueses of two/more results passed into Combine ? Imagine the code below

Result<string> result1 = GetName();
Result<int> result2 = GetAge();
Result.Combine(result1, result2).Bind(nameAndAge => ...)

Can I somehow use Result.Combine so that nameAndAge contains valueses of result1 and result2 (as a tuple, anonymous type, etc.) ?

macpak avatar Jul 10 '22 16:07 macpak

Unfortunately, there's no way to do so at the moment. I'm marking this is a a protentional enhancement, feel free to submit a PR.

vkhorikov avatar Jul 11 '22 10:07 vkhorikov

@vkhorikov Just found that #342 solves what I was asking about.

macpak avatar Jul 16 '22 12:07 macpak