title: Entity Framework, multiple views to same model
body: <p>I have multiple views (9 or so) that all return the same columns, and in EF I want to map them to the same model. I reverse engineered my ef code with EF Power Tools which gave me multiple models with the same fields, so I want to just use one model instead.
  However, with the way I currently have it, my DbSet only contains the items from the last built model.
  Basically, it's like this:</p>
  <pre><code>View1
  ID int,
  Name varchar(100)
  
  View2
  ID int,
  Name varchar(100)
  
  public virtual DbSet&lt;Person&gt; Persons{ get; set; }
  
  protected override void OnModelCreating(ModelBuilder modelBuilder)
  {
          modelBuilder.Entity&lt;Person&gt;(entity =&gt;
          {
              entity.ToView(&quot;View1&quot;, &quot;dbo&quot;);
              //...
          });
  
          modelBuilder.Entity&lt;Person&gt;(entity =&gt;
          {
              entity.ToView(&quot;View2&quot;, &quot;dbo&quot;);
              //...
          });
  }
  </code></pre>
  <p>When I view Persons, it only has data from View2 in it.
  I'm not sure if this is even possible in ef, let alone how to do it.</p>
  <p>I know I could union all the views in another view and map that one, but I'm trying to use as little sql as possible.</p>