Using IDbContext and Moq4 to ease DI and test your Entity Framework context and code.
An implementaion of IDbContext to use for testing
![](https://johanbostrom.se/blog/using-idbcontext-and-moq4-to-ease-di-and-test-your-entity-framework-context/idbcontext.png)
It’s now been a while since Microsoft released entity framework core and with this released I hoped for them to release an interface for DbContext. (Spoiler alert) Unfortunately they didn’t.
Share this post
Twitter
Facebook
Reddit
LinkedIn