Tag Archives: Entity Framework

Mocking Entity Framework to unit test your data services

It’s not easy to write unit tests for services that use DbContext and DbSet<T> classes from Entity Framework (or Entity Framework Core), and there are complex solutions to approach this, like separating the data access layer completely, as I propose in my UnitOfWork-EntityFramework implementation. … Continue reading

Posted in Architecture, C# | Tagged , , , , , , | Leave a comment

Unit of work over Entity Framework

Many unit of work and repository implementations over Entity Framework do not respect the interfaces of the patterns correctly, and therefore the abstractions do not serve any purpose. In my opinion, the single reason for (and goal of) abstracting unit of work and … Continue reading

Posted in .NET | Tagged , , , , | 5 Comments