Friday August 28th

Thursday August 27th

2 Kicks

Simplify common data access functions by using Entity Framework extens

Simple project featuring usage of EntityFramework CodeFirst and overriding SaveChanges method of DBContext in order to keep record of changes on entities in database. There is a simple usage sample project and a test project with couple of test cases to confirm that everything is working.

4 comments

You've nailed it here, the repository pattern is not what we want. Entity Framework already implements the unit-of-work pattern via the context object, as you point out. Extending it there is the correct choice, rather than trying to mix and match the unit-of-work and repository patterns.

I am bit confused by IEntityMap and JContext. Are these classes some kind of custom classes? Or is it part of a framework?

These are custom classes, but JContext inherits from DbContext, which is part of EntityFramework (4.1). You have full source code on github (link in article), and you can download it to see/use it.

Commenting on Stories is limited for now and will open up to those recommended by the community. Learn how
Loading DotNetKicks...
brought to you by the Kicks Network