title: EF Core entity inheritance from different sources without discriminator
body: <p>I am trying to configure the two entities shown below with EF Core:</p>
  
  <p><strong>User:</strong></p>
  
  <pre><code>public class User
  {
      public int UserId { get; set; }
      public string Title { get; set; }
      public string Name { get; set; }
      public string Surname { get; set; }
      [Required]
      public string Email { get; set; }
  
      [NotMapped]
      public string FriendlyIdentifier
      {
          get
          {
              var name = $"{Name} {Surname}";
              if (!string.IsNullOrWhiteSpace(name))
                  return name;
              else if (!string.IsNullOrWhiteSpace(Email))
                  return Email;
              else
                  return UserId.ToString();
          }
      }
  
      public ICollection&lt;Booking&gt; Bookings { get; set; }
  }
  </code></pre>
  
  <p><strong>UserDetails:</strong></p>
  
  <pre><code>public class UserDetails : User
  {
      public DateTime? LatestBookingDate { get; set; }
  }
  </code></pre>
  
  <p>The reason for this is that I want to be able to pull users with their latest booking date without having to pull all the booking and then determine the latest booking date manually in code. To achieve this I have created a SQL view which selects the latest booking date and I want to bind <code>UserDetails</code> to this view.</p>
  
  <p>I have the following EF setup:</p>
  
  <pre><code>modelBuilder.Entity&lt;User&gt;(builder =&gt;
  {
      builder.ToTable("userdetails");
      builder.HasKey(x =&gt; x.UserId);
      builder.HasIndex(x =&gt; new { x.Name, x.Surname, x.Email });
  });
  
  modelBuilder.Query&lt;UserDetails&gt;()
      .ToView("view_userdetails");
  </code></pre>
  
  <p>But this gives the following error when trying to select a <code>UserDetails</code> entity:</p>
  
  <blockquote>
    <p>'Cannot set 'User' as the base type of 'UserDetails'. Inheritance
    hierarchies cannot contain a mix of entity types and query types.'</p>
  </blockquote>
  
  <p>I am aware that there is a <code>HasDiscriminator</code> extension as described here: <a href="https://docs.microsoft.com/en-us/ef/core/modeling/relational/inheritance" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/ef/core/modeling/relational/inheritance</a> but I don't really have a discriminator as <code>UserDetails</code> is just an extension of <code>User</code>.</p>
  
  <p>Is there any way for me to get this working? I don't really want to duplicate the properties of <code>User</code> into <code>UserDetails</code> because then there's two entities to maintain when anything changes. I would like to retain the inheritance.</p>