How to make an async call from within the Match function in C# #1082
Replies: 3 comments 7 replies
-
|
Personally, I think something like this would be cleaner. I made a dummy Connection object above all of this to just to keep your types the best I can. I also over-loaded these so you can change those boolean values to true if you want to see how the errors are wrapped up in action. I will also note, I'm no expert in all of this. Others may have a better suggestion, but this is how I would do it. |
Beta Was this translation helpful? Give feedback.
-
|
In my example, you could always chain them all together, but here is another solution using the original code you had. Is this more what you had in mind? |
Beta Was this translation helpful? Give feedback.
-
|
Here is what I ended up with: @evermanwa Thanks a lot for your input, I certainly got inspiration from you with the Either type. Still keen to know if there's a nother/better way of doing this. Thanks alot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
After having watched this video by Nich Chapsas, I started using the LanguageExt library to replace exceptions in our code. I'm primarily using the Match function like so:
My question is, how do I make the second async call from within the Match function? Is this possible, or what's the alternative? I'm hoping I haven't hit a wall with the library.
Cheers,
Beta Was this translation helpful? Give feedback.
All reactions