this post was submitted on 10 Aug 2024
17 points (94.7% liked)

C Sharp

1527 readers
31 users here now

A community about the C# programming language

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

founded 1 year ago
MODERATORS
 

A collection of tools for dealing with nulls, failures and the generic type issues that arise in this domain.

https://github.com/Andy3432344/SafeResults

I'm the author, let me know what you think!

*Edit: updated to show GitHub link, sorry!

you are viewing a single comment's thread
view the rest of the comments
[โ€“] Cyno@programming.dev 3 points 3 months ago* (last edited 3 months ago) (1 children)

I'm not that familiar with newer c# code and only recently started with result pattern but tbh, I can't tell what is this code supposed to do. Does opt resolve to true or false in this case? Why do you want TestStringFail to always execute, and what should it return? Why is opt.None true when it was initialized with a valid string value, what does None even mean in this context?

[โ€“] DrDeadCrash@programming.dev 1 points 3 months ago

Check the edit on the post, I thought I had linked to the GitHub page but I guess the image overrides that.

Link: https://github.com/Andy3432344/SafeResults