title: Mocking repository with Entity Framework
body: <p>I'm using mog for mocking a repository with LINQ to SQL like this:</p>
  
  <pre><code>public static IProductsRepository MockProductsRepository(params Product[] prods){
      // Generate an implementer of IProductsRepository at runtime using Moq
      var mockProductsRepos = new Mock&lt;IProductsRepository&gt;();
      mockProductsRepos.Setup(x =&gt; x.Products).Returns(prods.AsQueryable());
      return mockProductsRepos.Object;
  }
  
  public interface IProductsRepository{
      IQueryable&lt;Product&gt; Products { get; }
      void SaveProduct(Product product);
      void DeleteProduct(Product product);
  }
  </code></pre>
  
  <p>How can I change this function for the Entity framework if I am using it like this:</p>
  
  <pre><code>public interface IProductsRepository : IEntities{
      EntityState GetEntryState(object entry);
      void SetEntryState(object entry, EntityState state);
      void Commit();
  }
  
  public interface IEntities{
      DbSet&lt;Product&gt; Products { get; set; }
  }
  </code></pre>
  
  <p>Now I am using <code>DbSet</code>.</p>