Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no IDbContext because it would be useless, the only implementation of it would be the DbContext.</p> <p>EF team is also going this way with IDbSet if you look at this <a href="https://entityframework.codeplex.com/wikipage?title=Design%20Meeting%20Notes%20-%20May%2016,%202013" rel="nofollow">design meeting note</a></p> <p>For me, the real problem with EF when it comes to unit testing is the DbConnection in the DbContext, fortunately there is <a href="https://effort.codeplex.com/" rel="nofollow">Effort</a> a nice project on codeplex that starts to fill this.</p> <blockquote> <p>Effort is a powerful tool that enables a convenient way to create automated tests for Entity Framework based applications. It is basically an ADO.NET provider that executes all the data operations on a lightweight in-process main memory database instead of a traditional external database. It provides some intuitive helper methods too that make really easy to use this provider with existing ObjectContext or DbContext classes. A simple addition to existing code might be enough to create data driven tests that can run without the presence of the external database.</p> </blockquote> <p>With this, you can leave your DbContext and DbSet as is and do your unit tests easily. The only drawback with this is the difference between Linq providers where some unit tests may pass with effort and not with the real backend.</p> <p><strong>UPDATE with EF7</strong></p> <p>I still maintain that IDbContext would be useless and the problem comes from the DbConnection.</p> <p>EF7 will not have an IDbContext either, in order to do unit testing they are now giving an in memory provider.</p> <p>You can see Rowan Miller doing a demo here: <a href="http://channel9.msdn.com/events/Ignite/2015/BRK3727" rel="nofollow">Modern Data Applications with Entity Framework 7</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload