C H A P T E R  24

Implementing a Persistent Repository

In this chapter, we are going to fix the most pressing problem in our example application—a lack of proper model persistence. To do this, we will use the Entity Framework again but in a different way to the approach we used previously.

In the earlier chapters, we relied on the Entity Framework to generate the classes that represented rows in our database tables. We don't really want to cede control of our model classes in an MVC framework, and our goal is to create a repository in such a way that our model classes are not persistence-aware. This approach has a couple of advantages. The first is that we don't have to update all of the references to our model classes if we change ORM technologies, ...

Get Applied ASP.NET 4 in Context now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.