summaryrefslogtreecommitdiff
path: root/src/marlin.web/Util/IQueryableExtensions.cs
blob: 79b9cbe9b4e70c7254bbb45e454b7be527b65d78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
namespace marlin.web.Util;

using System.Linq.Expressions;

public static class IQueryableExtensions
{
    public static IQueryable<T> WhereIf<T>(
        this IQueryable<T> self,
        bool cond,
        Expression<Func<T, bool>> predicate)
    {
        return cond ? self.Where(predicate) : self;
    }
}