Refactor IQueryable and IEnumerable that share the same condition I have extension methods to encapsulate query conditions, however I have to separate IQueryable and IEnumerable. Is there any way I can reduce the redundancy and still not lose the performance benefit of IQueryable?

public static class PAYTRACK_PARTNER_Extension 
{
    public static IQueryable&lt;PAYTRACK_PARTNER&gt; WhereInPayer(this IQueryable&lt;PAYTRACK_PARTNER&gt; query, int payerId)
    {
        var result = query.Where(q =&gt; q.payer_id == payerId);
        return result;
    }

    public static IEnumerable&lt;PAYTRACK_PARTNER&gt; WhereInPayer(this IEnumerable&lt;PAYTRACK_PARTNER&gt; query, int payerId)
    {
        var result = query.Where(q =&gt; q.payer_id == payerId);
        return result;
    }

    public static IQueryable&lt;PAYTRACK_PARTNER&gt; WhereInPayee(this IQueryable&lt;PAYTRACK_PARTNER&gt; query, int payeeId)
    {
        var result = query.Where(q =&gt; q.payee_id == payeeId);
        return result;
    }

    public static IEnumerable&lt;PAYTRACK_PARTNER&gt; WhereInPayee(this IEnumerable&lt;PAYTRACK_PARTNER&gt; query, int payeeId)
    {
        var result = query.Where(q =&gt; q.payee_id == payeeId);
        return result;
    }


    public static IQueryable&lt;PAYTRACK_PARTNER&gt; WhereIsNotApproved(this IQueryable&lt;PAYTRACK_PARTNER&gt; query)
    {
        var result = query.Where(q =&gt; q.partner_is_approve.GetValueOrDefault(false).Equals(false));
        return result;
    }

    public static IEnumerable&lt;PAYTRACK_PARTNER&gt; WhereIsNotApproved(this IEnumerable&lt;PAYTRACK_PARTNER&gt; query)
    {
        var result = query.Where(q =&gt; q.partner_is_approve.GetValueOrDefault(false).Equals(false));
        return result;
    }

    public static PAYTRACK_PARTNER SingleByPayerAndPayee(this IQueryable&lt;PAYTRACK_PARTNER&gt; query, int payerId, int payeeId)
    {
        var result = query.Single(q =&gt; q.payer_id == payerId &amp;&amp; q.payee_id == payeeId);
        return result;
    }

    public static PAYTRACK_PARTNER SingleByPayerAndPayee(this IEnumerable&lt;PAYTRACK_PARTNER&gt; query, int payerId, int payeeId)
    {
        var result = query.Single(q =&gt; q.payer_id == payerId &amp;&amp; q.payee_id == payeeId);
        return result;
    }
}
You can use IQueryable&lt;T&gt; everywhere, because you can convert to it from IEnumerable&lt;T&gt; by using AsQueryable():

public static IQueryable&lt;PAYTRACK_PARTNER&gt; WhereInPayer(
    this IQueryable&lt;PAYTRACK_PARTNER&gt; query, int payerId)
{
    var result = query.Where(q =&gt; q.payer_id == payerId);
    return result;
}

public static IEnumerable&lt;PAYTRACK_PARTNER&gt; WhereInPayer(
     this IEnumerable&lt;PAYTRACK_PARTNER&gt; query, int payerId)
{
     return query.AsQueryable().WhereInPayer(payerId);
}


Also, names in ALL_CAPS are not commonly used in C#, you should adopt c# naming conventions.