Entity framework 导航属性可以是泛型类型吗?

Entity framework 导航属性可以是泛型类型吗?,entity-framework,entity-framework-migrations,entity-framework-6,Entity Framework,Entity Framework Migrations,Entity Framework 6,我有一个导航属性public virtual IUser CreateBy{get;set;} 当我尝试添加迁移add migration InitialMigration时,出现以下错误: 导航属性“CreateBy”不是类型“Passo”上声明的属性。验证它是否未被明确地从模型中排除,以及它是否是有效的导航属性 我的类型Passo public class Passo : EntityNome, IAuditable { public virtual int? Ordem { get

我有一个导航属性
public virtual IUser CreateBy{get;set;}

当我尝试添加迁移
add migration InitialMigration
时,出现以下错误:

导航属性“CreateBy”不是类型“Passo”上声明的属性。验证它是否未被明确地从模型中排除,以及它是否是有效的导航属性

我的类型
Passo

public class Passo : EntityNome, IAuditable
{
    public virtual int? Ordem { get; set; }
    public virtual Passo ProximoPasso { get; set; }
    public virtual ICollection<User> Responsaveis { get; protected set; }
    public virtual IList<CheckListItemTemplate> CheckListItens { get; protected set; }

    public virtual DateTime CreateAt { get; protected internal set; }
    public virtual IUser<int> CreateBy { get; set; }
    public virtual DateTime? UpdateAt { get; protected set; }
    public virtual IUser<int> UpdateBy { get; set; }
}
公共类密码:实体名称,IAuditable
{
公共虚拟int?Ordem{get;set;}
公共虚拟Passo ProximoPasso{get;set;}
公共虚拟ICollection响应为{get;protected set;}
公共虚拟IList检查列表项{get;protected set;}
在{get;protected internal set;}创建公共虚拟日期时间
公共虚拟IUser CreateBy{get;set;}
公共虚拟日期时间?UpdateAt{get;protected set;}
公共虚拟IUser UpdateBy{get;set;}
}

IUser是int的集合?无法导航到基本体

它需要是上下文中声明的表的集合或引用

public DbSet<int> Integers { get; set; }// you cant declare table of integers ??? 
public DbSet Integers{get;set;}//不能声明整数表???
//此外,EF需要公共get/set,这将被忽略 公共虚拟ICollection响应为{get;protected set;}

请参见导航概念