using System.Linq.Expressions;
// ReSharper disable once CheckNamespace
namespace System.Linq
{
public static class Queryable
{
///
/// Makes a where filtering, if it is not null.
///
public static IQueryable WhereOrDefault(this IQueryable source, Expression>? predicate)
{
if (source == null) throw new ArgumentNullException(nameof(source));
return predicate is null ? source : source.Where(predicate);
}
}
}