Cross-cutting delete flag in a repository I want to have a cross-cutting delete flag in my repository. I have the following repository pattern at the moment:

public interface IRepo&lt;TModel&gt; where TModel : EntityBase&lt;int&gt;
    {
        TModel Add(TModel item);
        void Add(IEnumerable&lt;TModel&gt; entities);
        TModel Remove(TModel item);
        TModel Find(int itemId);
        TModel Get(int itemId);
        IQueryable&lt;TModel&gt; Query { get; }
    }


I am exposing IQueryable which makes it hard to control whether deleted entities are retrieved or not in my service layer. Would adding a method to my repository which replaces Query and exposes a pre-filtered IEnumerable be bad form?

public IEnumerable&lt;TEntity&gt; GetAll
{
    get { return this.dbset.AsEnumerable().Where(x =&gt; x.IsDeleted == false); }
}


I am assuming since IQueryable is lazily loaded I won't pulling more entities into memory than required? Is this naive?
You don't need to call AsEnumerable on the DbSet in fact, doing so isn't great at all... As far as I am aware, this will make your Where clause execute in C# rather than being translated to SQL meaning a massive perf hit (I would be happy to be corrected here).

You should return IQueryable&lt;TEntity&gt; directly:

return dbSet.Where(x =&gt; !x.IsDeleted);


Notice that I've removed the redundant this. and also changed the comparison to use ! (not operator) instead of comparing to false.

One additional warning I would give you is: are you sure you need a generic base class repository? I find that when I have used this pattern a lot of my repositories get methods they never use. 

It can also be argued that it's a leaky abstraction, see e.g here and here

I prefer slim interfaces of only a few methods rather than using header interfaces.