Conversation
|
This would be a great addition to the library. |
|
You guys know that this is already possible? OneOf.OneOf<string, uint> test = 15;
var result = await test.Match(
async str => await Task.FromResult(str),
async i => await Task.FromResult(i.ToString()));Instead of switch you can also use a Match, that just returns a |
|
|
Yes. This should be possible with this PR. Just a note as I guess what you meant was |
Yes. I think this test is exactly that. In this case is not awaiting inside the lambda, but could be written as |
|
Can you publish the version containing this feature to NuGet please? :-) |
Created versions of Map, Switch and Match that are awaitable, for references on netstandard 2.0 or greater than .Net 4.0