title: Implementing Generic Service for CRUD operations using EF6
body: <p>I've done multiple projects using the Repository pattern(Interface=>Repository)but now, I'm facing a new challenge(not a big one) with one of my coworker's code. We are implementing a Generic service that contains all of the CRUD operations methods for all entity classes. </p>
  
  <p>We are using Database first in this project, and have the following structure, </p>
  
  <blockquote>
    <p>aspx.cs > entityclass(AppUser) > Generic Service > Entity model. </p>
  </blockquote>
  
  <pre><code>   public class UserServices : GenericServices&lt;User&gt;
     { //Implemented methods }
  </code></pre>
  
  <p>And this as the Generic Service: </p>
  
  <pre><code>public class GenericServices&lt;T&gt; where T : class
  {
      App_dbEntities _db;
      IDbSet&lt;T&gt; ent;
  
      public GenericServices()
      {
          _db = new App_dbEntities();
          ent = _db.Set&lt;T&gt;();
      }
  
      public IEnumerable&lt;T&gt; Select()
      {
          return ent;
      }
  
      public T Select(string id)
      {
          ??
      }
  }
  </code></pre>
  
  <p>I'm trying to handle the entities's properties but since this is Generic, it doesn't know what entity am handling at the moment. I've seen some examples using predicate as a function parameter. Please give me a hand. </p>