title: A .NET EF Repository pattern
body: <p>I inherited a .NET CORE project and have come across a setup I don't fully understand.</p>
  <p>There is a <code>DbContext</code> in the DAL with &quot;Domiain&quot; and &quot;Entity&quot; models e.g.</p>
  <pre><code>&gt; DAL
    &gt; Models
      &gt; Domain
        Person.cs
        Car.cs
      &gt; Entity
        PersonEntity.cs
        CarEntity.cs
    &gt; Repositories
      &gt; PersonRepository.cs
      &gt; CarRepository.cs
  </code></pre>
  <p>And in each repository, the <code>DbContext</code> is accessed to get the <code>Person</code> model - which is immediately automapped like-for-like to the <code>Entity</code> model</p>
  <p>I cannot find any differences between the Entity and the Domain models - so what is the point? What situation would demand this setup?</p>
  <p>I understand <code>ViewModels</code> usage and abstracting to different models <em>in a business logic layer</em> but I can't think of an example where the repository commands would return or use a different model to the <code>Domain</code> models given here.</p>
  <p>Does anyone have any experience with this?</p>