17 lines
458 B
C#
17 lines
458 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace BITKit
|
|||
|
{
|
|||
|
public static partial class Extensions
|
|||
|
{
|
|||
|
public static IEnumerable<TResult> SelectWhere<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector)
|
|||
|
{
|
|||
|
return source.Where(x => selector.Invoke(x) is not null).Select(x => selector.Invoke(x));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|