title: Data Access Layer and DDD
body: <p>I am trying to learn the idea of Domain Driven Design and trying to figure out where should we put the Database persistence code.</p>
  
  <p>Going through the book "Implementing Domain Driven Design by Vaughn Vernon", I understand that the Repository or the Database operations (along with connections etc.,) have to be kept in the Model project (Domain Model Context) itself. Is my understanding correct?</p>
  
  <p>I am referring to his sample of IdentityAccessContext, AgilePMContext etc., where there are interfaces to the repository. I had always grown with an idea of having a separate Data Layer and adding one here leads me to circular dependency. Because the Interfaces, Entities are declared in Model which is required for the Data layer and the Data layer needs to be referred from model for persistence.</p>
  
  <p>Is this correct or am I missing something? </p>