fix: remove duplicate Choose extension
This commit is contained in:
parent
9032294964
commit
5a2bd690f7
|
@ -27,10 +27,4 @@ public static class MaybeExtensions
|
||||||
|
|
||||||
public static T? ToNullable<T>(this Maybe<T> item) where T : struct =>
|
public static T? ToNullable<T>(this Maybe<T> item) where T : struct =>
|
||||||
item.HasValue ? item.Value : null;
|
item.HasValue ? item.Value : null;
|
||||||
|
|
||||||
public static IEnumerable<TOutput> Choose<TInput, TOutput>(this IEnumerable<TInput> enumerable, Func<TInput, Maybe<TOutput>> mapper) =>
|
|
||||||
enumerable
|
|
||||||
.Select(mapper)
|
|
||||||
.Where(x => x.HasValue)
|
|
||||||
.Select(x => x.Value);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user