Closed GregOnNet closed 2 years ago
I believe this is the correct behavior.
Just like with Result<T>
, .bind
will flatten the Result<T>
and .map
will convert its inner value.
In CSharpFunctionalExtensions, the async Bind returns a Task<Result<T>>
, but async Map would return a Task<Result<Result<T>>
if K
in Func<T, Task<K>> func
was a Result<T>
.
Cool, thanks for the feedback.
I was not ware that bind
is the flattening-Operation, here. 👍
Describe the bug I have a ResultChain that calls a Method returning ResultAsync. My expectation is, that ResultAsync is transparent for the Chain, but
ResultAsync
is passed to the next operator.To Reproduce
UPDATE
If I use
.bind
instead of.map
the code works as expected. 🚀Expected behavior My expectation is, that ResultAsync is transparent for the Chain, but
ResultAsync
is passed to the next operator.Screenshots
Desktop (please complete the following information):
Additional context I am willing to help to fix this issue if it becomes confirmed as bug.