title: linq to entities can not convert int to string
body: <p>I try to filtering the data that return to kendo combo box, the filtering is based on the ID,
  I need to return all records that contains the filtration text not only the equals one, so what I did is to cast the ID to string as the following snip</p>
  
  <pre><code>Items = Mapper.Map&lt;List&lt;PurchaseOrder&gt;, List&lt;PurchaseOrderViewModel&gt;&gt;(
                  purchaseOrderRepository.GetMany(x =&gt; 
                                                  x.PurchaseOrderID
                                                   .ToString()
                                                   .Contains(text))
                                                   .ToList());
  </code></pre>
  
  <p>but it's always return 
  linq to entities does not recognize the method 'system.string tostring()'</p>
  
  <p>so I tried to convert the dbset to list before the where statement as I found in another post
  <a href="https://stackoverflow.com/questions/18233495/linq-to-entities-does-not-recognize-the-method-system-string-tostring-method">LINQ to Entities does not recognize the method &#39;System.String ToString()&#39; method in MVC 4</a>
  but I got another error says that the list does not contains a definition for Where (dbSet is an instance of IDbSet)</p>
  
  <pre><code>public virtual IList&lt;T&gt; GetMany(Expression&lt;Func&lt;T, bool&gt;&gt; where)
  {
  
      return dbset.ToList().Where(where).ToList();
  }
  </code></pre>
  
  <p>here is My original(current) get method</p>
  
  <pre><code>sing System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Data.Entity;
  using System.Data;
  using System.Linq.Expressions;
  using Spine.ERP.DataAccess.DbFirstDataAccess;
  using Spine.ERP.DataModel.Helpers;
  namespace Spine.ERP.DataAccess.Infrastructure
  {
      public abstract class RepositoryBase&lt;T&gt; where T : class
      {
  
          private SSSDBEntities dataContext;
  
          private readonly IDbSet&lt;T&gt; dbset;
  
          protected RepositoryBase(IDatabaseFactory databaseFactory)
          {
              DatabaseFactory = databaseFactory;
              dbset = DataContext.Set&lt;T&gt;();
          }
  
         protected IDatabaseFactory DatabaseFactory
          {
              get;
              private set;
          }
  
  
          protected SSSDBEntities DataContext
          {
              get { return dataContext ?? (dataContext = DatabaseFactory.Get()); }
          }
      public virtual IQueryable&lt;T&gt; GetMany(Expression&lt;Func&lt;T, bool&gt;&gt; where)
          {
              return dbset.Where(where);
          }
    }
  }
  </code></pre>
  
  <p>Any other thing can I do to solve this problem?</p>