Crafting Your Own Data Access Layer

Under the covers of the data context class, a number of interesting things happen that represent the body and soul of the DAL. A DAL is about persistence, management of business transactions, concurrency, lazy loading, maybe caching, and more. In this section, we’ll basically go through the typical responsibilities we’ve already identified for a DAL.

Implementing the Persistence Layer

The main purpose of the persistence layer is to provide a mapping between the types in the domain logic and physical tables in the DBMS. You resort to data context methods such as Add, Delete, or Update when you just want to make persistent any changes (insertions, deletions, or updates) to objects in the domain model.

So with an ...

Get Microsoft® .NET: Architecting Applications for the Enterprise now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.