We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I don't generate Option<TCollection> very often, but when it happens I almost always end up transforming the Option.None case to an empty collection.
Option<TCollection>
Option.None
public static IEnumerable<T> ValueOrEmpty<T>(this Option<IEnumerable<T>> option) { return option.ValueOrDefault(Enumerable.Empty<T>()); } public static IReadOnlyCollection<T> ValueOrEmpty<T>(this Option<IReadOnlyCollection<T>> option) { return option.ValueOrDefault(Array.Empty<T>()); } public static T[] ValueOrEmpty<T>(this Option<T[]> option) { return option.ValueOrDefault(Array.Empty<T>()); }
The text was updated successfully, but these errors were encountered:
I like this. I've added it to the Function 3 milestone. I don't remember. Are you one .NET Core or stuck on Framework?
Sorry, something went wrong.
No branches or pull requests
I don't generate
Option<TCollection>
very often, but when it happens I almost always end up transforming theOption.None
case to an empty collection.The text was updated successfully, but these errors were encountered: