title: The entity type 'System.Collections.Generic.IEnumerable`1[SomeModel]' provided for the argument 'clrType' must be a reference type
body: <p>I'm getting the error message </p>
  
  <blockquote>
    <p>The entity type 'System.Collections.Generic.IEnumerable`1[SomeModel]' provided for the argument 'clrType' must be a reference type.</p>
  </blockquote>
  
  <p>When I try to do <code>add-migration</code>. I have no idea what and where the problem is here. </p>
  
  <p>I don't know what is wrong with the <code>UserRequest</code> class.</p>
  
  <p>I saw some similar questions, but their problem was with inherited controllers and similar.</p>
  
  <p>Thank you! Any help is welcome!</p>
  
  <pre><code>public class UserRequest
  {
      [ScaffoldColumn(false)]
      [System.ComponentModel.DataAnnotations.Schema.DatabaseGenerated(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity)]
      public int Id { get; set; }
  
      public int UserAccountId { get; set; }
      public RequestCode RCode { get; set; }
      public string CodeText { get; set; }
  }
  
  public class UserAccount
  {
      [ScaffoldColumn(false)]
      [System.ComponentModel.DataAnnotations.Schema.DatabaseGenerated(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity)]
  
      public int UserAccountId { get; set; }
  
      [Required(ErrorMessage = "First Name is required.")]
      public string FirstName { get; set; }
      [Required(ErrorMessage = "Second Name is required.")]
      public string LastName { get; set; }
      [Required(ErrorMessage = "Email is required.")]
      [RegularExpression(@"^([\w-\.]+)@((\[[0-9]{1,3]\.)|(([\w-]+\.)+))([a-zA- 
          Z{2,4}|[0-9]{1,3})(\]?)$",
          ErrorMessage = "Please enter valid email.")]
      public string Email { get; set; }
      [Required(ErrorMessage = "Username is required.")]
      public string UserName { get; set; }
      [Required(ErrorMessage = "Password is required.")]
      [DataType(DataType.Password)]
      public string Password { get; set; }
      [Compare("Password", ErrorMessage = "Please confirm your password.")]
      [DataType(DataType.Password)]
      public string ConfirmPassword { get; set; }
  
      public Role MyRole { get; set; }
  
      public UserAccount()
      {
          MyRole = Role.Customer;
      }
  }
  
  public class Administrator : UserAccount 
  {
      public IEnumerable&lt;UserRequest&gt; ReceievedRequests { get; set; }
  }
  
  public class Customer : UserAccount
  {
      public int Spent { get; set; }
      public ShoppingCart Cart { get; set; }
      public virtual IEnumerable&lt;UserRequest&gt; UserRequests { get; set; }
  }
  </code></pre>
  
  <p>DataAccessLayer:</p>
  
  <pre><code>public class TalonContext : DbContext
  {
      public TalonContext() { }
  
      public TalonContext(DbContextOptions&lt;TalonContext&gt; options) : 
          base(options) { }
  
      public DbSet&lt;UserAccount&gt; Users { get; set; }
      public DbSet&lt;UserRequest&gt; Requests { get; set; }
  
      protected override void OnModelCreating(ModelBuilder modelBuilder)
      {
          modelBuilder.Entity&lt;Administrator&gt;()
              .HasMany(r =&gt; r.ReceievedRequests);
  
          //modelBuilder.Entity&lt;Customer&gt;()
          //    .HasOne(r =&gt; r.UserRequests);
  
          modelBuilder.Entity&lt;Customer&gt;()        // &lt;--fixed
              .HasMany(r =&gt; r.UserRequests);
  
          modelBuilder.Entity&lt;UserRequest&gt;()
              .HasAlternateKey(k =&gt; k.UserAccountId);
      }
  }
  </code></pre>