title: How to implement method of type Expression<Func<T, bool>> where
body: <p>So I have a repository abstract class with a method called GetMany like this:</p>
  
  <p>public virtual IEnumerable GetMany(Expression> where)</p>
  
  <p>how to implement this in the derived class?</p>
  
  <p>Infrastructure:</p>
  
  <pre><code>public abstract class RepositoryBase&lt;T&gt; where T : class
      {
          #region Properties
          private ApplicationDbContext dataContext;
          private readonly IDbSet&lt;T&gt; dbSet;
  
          protected IDbFactory DbFactory
          {
              get;
              private set;
          }
  
          protected ApplicationDbContext DbContext
          {
              get { return dataContext ?? (dataContext = DbFactory.Init()); }
          }
          #endregion
  
          protected RepositoryBase(IDbFactory dbFactory)
          {
              DbFactory = dbFactory;
              dbSet = DbContext.Set&lt;T&gt;();
          }
  
          #region Implementation
          public virtual IEnumerable&lt;T&gt; GetMany(Expression&lt;Func&lt;T, bool&gt;&gt; where)
          {
              return dbSet.Where(where).ToList();
          }
  
          #endregion
  
      }
  </code></pre>
  
  <p>Service:</p>
  
  <pre><code>public interface IRepositoryBase&lt;T&gt; where T : class
      {
          RepositoryBase&lt;T&gt; GetBase&lt;T&gt;();
      }
      public class ApplicationUserManager : UserManager&lt;ApplicationUser, int&gt;, IRepositoryBase&lt;AppAccessPolicy&gt;
      {
          public ApplicationUserManager(IUserStore&lt;ApplicationUser, int&gt; store)
              : base(store)
          {
              PasswordValidator = new CustomPasswordValidator();
          }
  
          private RepositoryBase&lt;T&gt; GetBase&lt;T&gt;()
          {
              var baseClass = GetBase&lt;T&gt;();
              return baseClass;
          }
  
  
          public override IEnumerable&lt;AppInstitution&gt; GetMany(Expression&lt;Func&lt;AppInstitution, bool&gt;&gt; where)
          {
              return dbSet.Where(where).ToList();
          } 
  
         . . . .
   }
  </code></pre>
  
  <p>I need to know how to properly implement this part:</p>
  
  <p><strong>public override IEnumerable GetMany(Expression> where)
          {
              return dbSet.Where(where).ToList();
          }</strong> </p>