title: How can I use derived class when inherite from an interface
body: <p>I tried to create my DbContext like this:</p>
  
  <pre><code>public interface IMyDbContext
  {
      IQueryable&lt;Product&gt; Products { get; set; }
  }
  public class MyDbContext: DbContext, IMyDbContext
  {
      public DbSet&lt;Product&gt; Products { get; set; }
  }
  </code></pre>
  
  <p>I don't want to use <code>IDbSet</code> in the interface because that class is used in another projects which does not use EntityFramework.</p>
  
  <p>Visual Studio said that <code>MyDbContext</code> does not implement the member <code>IQueryable&lt;Product&gt;</code>, but <code>DbSet&lt;Product&gt;</code> is derived from <code>IQueryable&lt;Product&gt;</code>: <a href="https://msdn.microsoft.com/en-us/library/gg696460(v=vs.113).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/gg696460(v=vs.113).aspx</a></p>
  
  <p>Could you please tell me why? And how can I fix this issue?</p>
  
  <p>Thank you a lot.</p>