Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 实体框架中的整数列表 公共类动物 { 公共int Id{get;set;} 公共字符串名称{get;set;} 公共ICollection所有者ID{get;set;} }_C#_Entity Framework_Entity Framework 4_Entity Framework 4.1 - Fatal编程技术网

C# 实体框架中的整数列表 公共类动物 { 公共int Id{get;set;} 公共字符串名称{get;set;} 公共ICollection所有者ID{get;set;} }

C# 实体框架中的整数列表 公共类动物 { 公共int Id{get;set;} 公共字符串名称{get;set;} 公共ICollection所有者ID{get;set;} },c#,entity-framework,entity-framework-4,entity-framework-4.1,C#,Entity Framework,Entity Framework 4,Entity Framework 4.1,Animal类包含int(所有者ID)列表 实体框架没有为OwnerID创建表,我如何映射它???添加第二个实体所有者,唯一的属性是int ID,添加它们之间的关系/关联。EF只能映射相关实体的集合。 public Class Animal { public int Id{get;set;} public string Name {get;set;} public ICollection<int> OwnerIds{ get; set; } }

Animal类包含int(所有者ID)列表


实体框架没有为OwnerID创建表,我如何映射它???

添加第二个实体所有者,唯一的属性是int ID,添加它们之间的关系/关联。

EF只能映射相关实体的集合。
public Class Animal
{
    public int Id{get;set;}
    public string Name {get;set;}

    public ICollection<int> OwnerIds{ get; set; }
}