Before Microsoft released MVC 4, I created my project with the good old ASP.NET Membership Provider. After release of MVC 4, Microsoft switched to SimpleMembership by WebMatrix. My project was pretty huge, so I searched for an upgrade path to switch without harming the project. I was in no luck finding a method to switch […]
Earlier I wrote an article about how to mock the LINQ DataContext. I promised to write an article about how to do the same method with Entity Framework. It’s quite similar, but the only difference is creating an IDbContext interface and using DbSet<T>.
When it comes to mocking the LINQ DataContext, it’s not an easy task to do, because DataContext (base class) doesn’t implement any interface, so you have to create a wrapper around the DataContext. I decided to follow the Unit Of Work pattern and created also a Generic Repository to access the model classes from the […]