2
私はまずEntity Framework 6のコードを使用しています。私は、コンソールnuGet
に更新データベースステートメントを実行すると、このエラーが表示さ、 'PK_dbo.EntityName'は制約ではありません。制約を落とすことができませんでした.EF34
public class Doctor
{
public string DoctorID { get; set; }
public string firstName { get; set; }
public string lastName { get; set; }
}
public class ExpertiseDetails
{
[Key, Column(Order = 1)]
public short expertiseID { get; set; }
[Key , Column(Order = 2)]
public string DoctorID { get; set; }
[ForeignKey("expertiseID")]
public Expertise expertise { get; set; }
public Doctor doctor { get; set; }
}
public class Expertise
{
[Key]
public short expertiseID { get; set; }
public string expertiseTitle { get; set; }
}
は、私が
Expertise
と
Doctor
間
one to many
realationshipを必要とする:
'PK_dbo.ExpertiseDetails' is not a constraint. Could not drop constraint
何が問題になっています私は、これらのような3エンティティを持っていますか?
私はあなたのデータベースにデータがあると思います。データを落としてもう一度試してください。 – Moein
@Moein。私はあなたの提案を試みますが、うまくいきません! – Majid