C# 运行Seed时出现外部约束错误
更新运行seed方法的数据库时出错 这是我的模型客户端:C# 运行Seed时出现外部约束错误,c#,entity-framework,C#,Entity Framework,更新运行seed方法的数据库时出错 这是我的模型客户端: public int ClientID { get; set; } [Required] public string portfolio { get; set; } public int ProfilID { get; set; } public int Re
public int ClientID
{
get;
set;
}
[Required]
public string portfolio
{
get;
set;
}
public int ProfilID
{
get;
set;
}
public int RestrictionID
{
get;
set;
}
public virtual Profil Profil
{
get;
set;
}
public virtual Restriction Restriction
{
get;
set;
}
限制:
public int RestrictionID
{
get;
set;
}
public string Restriction_name
{
get;
set;
}
public int ProfilID
{
get;
set;
}
public int RestrictionTypeID
{
get;
set;
}
public virtual Profil Profil
{
get;
set;
}
public virtual RestrictionType RestrictionType
{
get;
set;
}
限制类型{RestrictionTypeID,标签}
这是Profil{ProfilID,Profil_name}
我不知道问题是否是因为导航属性?我不知道发生了什么这是控制台中的错误消息:
引入外键约束
表“Restriction”上的“FK_dbo.Restriction_dbo.Profil_ProfilID”可以
导致循环或多个级联路径。指定在删除时不执行任何操作或
更新时不执行任何操作,或修改其他外键约束
提前感谢您的帮助 是的,它是实体框架可能的副本,这里是另一个: