Ryder Gillen

Results 4 comments of Ryder Gillen

First off I want to say I'm a big fan of the Optional library. I have been using it for about 2 years. However like many I have found it...

I wanted to chime in on this as I too have had trouble with Option/Async & code bloat. After much trial and error I came up with an alternative class...

This.... ```csharp var externalFlowId = (await _context.AuthenticFlows .Where(a => a.Id == id) .Select(a => a.Id).ToArrayAsync()) .SingleOrNone(); if (!externalFlowId.HasValue) return Option.None($"No flow found for authentic Id {id}"); var flowId = externalFlowId.ValueOrFailure();...

`TaskOption` is a hybrid, the 2nd type argument `B` is implied as `Exception`. This is necessary to handle `Task.Exception` vs. `Task.Result` otherwise the Exception would be suppressed and/or each `TaskOption`...