title: Generic Repository implementation fails with IEntity constraint
body: <p>I'm trying to implement a generic repository and it fails because there is no implicit conversion from the DBML object to the generic entity. I don't know how to make the DBML object inherit from IEntity, or if that is even the solution.</p>
  
  <p>Below are the interfaces and the repository signatures I'm using.</p>
  
  <pre><code>public interface IEntity
  {
      int ID { get; } 
  }
  
  public interface IRepository&lt;T&gt; : IDisposable
  {
      ....
  }
  
  public class Repository&lt;T&gt; : IRepository&lt;T&gt; where T : class, IEntity
  {
      ....
  }
  </code></pre>
  
  <p>This is the Model class. It fails with the error (below) at line 9 where an instance of the repository class is instantiated in the constuctor. This only started happening after I added the IEntity constraint to the Repository class.</p>
  
  <pre><code>public class MyModel
  {
      DataContext DC;
      Repository&lt;MyType&gt; MyRep;
  
      public MyModel()
      {
          DC = new DataContext("ConnStr");
          MyRep = new Repository&lt;MyType&gt;(DC);
  
      }
  }
  </code></pre>
  
  <p>Here is the error : The type cannot be used as type parameter 'T' in the generic type or method. There is no implicit reference conversion from 'MyType' to 'IEntity'</p>
  
  <p>Thanks in advance for your help.</p>