-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for Async #183
base: master
Are you sure you want to change the base?
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