emperador-ming

Results 5 comments of emperador-ming

Same here. We use: ``` public OneOf FindFoo() => aMethodThatReturnsFooOrNull() ?? None.Of(default!); ``` This would be great: ``` public OneOf FindFoo() => aMethodThatReturnsFooOrNull() ?? None.Of(); ```

Workaround ``` using OneOf; using OneOf.Types; namespace SuD.Domain.Extensions; public static class NoneExtensions { public static OneOf Of(this None _) => (OneOf)default(None); } ``` ``` public OneOf FindFoo() => aMethodThatReturnsFooOrNull() ??...

This is a complete example. https://youtu.be/7z-xjijYfcI

> Is there a better, more readable way to write the `Parse` method? @BADF00D, enter the monad! ```csharp #r "nuget: OneOf, 3.0.243" using OneOf; public class Parser { public OneOf...