title: Should entity objects be exposed by the repository?
body: <p>I have an repository which implements interface <code>IRepository</code>.  The repository performs queries on the Entity Framework (on behalf of) the application and directly returns the entity object produced.</p>
  
  <p>The whole point in implementing <code>IRepository</code> is so that it can be switched out for different repositories in the future.  However returning the exact entity objects as returned by the Entity Framework will break this. Is this acceptable?</p>
  
  <p>Therefore should the repository be converting all Entity Framework objects into business objects prior to exposing them to the application?  Should such objects implement an interface or have a common base type?</p>