title: Data Access Layer and MVC separation?
body: <p>How do I create an external DAL to my MVC project ?</p>
  
  <p>There is a one thing I really do not get. Suppose I have a model in my MVC project. Model's name is a Person {int id, string name}. </p>
  
  <p>Now in my DAL I have a method: </p>
  
  <p>public Person Select(int id) - which loads data from db and returns the Person object.</p>
  
  <p>This works fine if the DAL is a part of the MVC project. However when I create a class library for my external DAL (so I can use it in another application without referencing whole MVC project) it will not know the Person model because all models are hidden inside MVC project. </p>
  
  <p>I can't reference MVC project from DAL because MVC project needs to reference DAL to use it. I'm not interested in Entity Framework I want my own solution (not sure if EF even solves this).</p>
  
  <p>Is there a secret way to do it ? Or is my approach (of passing whole model) wrong and my Select method should return some sort of array or list with attributes ? I believe this is table data gateway concept (not sure), when just attributes are passed not whole objects.</p>