score:0

Accepted answer
protected override iqueryable<entity> applywhereclause(iqueryable<entity> entities)
{
    return entities.where(/* insert your extra where clause here */);
}

score:0

protected iqueryable<entityresult> getentities(etbdatacontext pcontext)
{
    var q = pcontext.entities
        .where(e => e.statuscode == "published")
        .where(e => getwherecondition(e))
        .orderbydescending(e => e.publishdate)
        .select(e => new entityresult
           {
               name = e.name,
               link = e.link
           });
}

protected virtual expression<func<entity, bool>> getwherecondition(entity e)
{
    return e => e.othercolumn == "othervalue";
}

score:3

 protected iqueryable<entityresult> getentities(etbdatacontext pcontext)
{
    return (from e in pcontext.entities
           where e.statuscode == "published"

           //is there a way to add a dynamic where clause here?
           //i would like to ask the inherited class for it's input:

           && e.othercolumn == "othervalue" // <-- like getwhere(e)?

           //without having to select the column

           orderby e.publishdate descending

           select e).firstordefault();
}

Related Query

More Query from same tag