我有兩個類:實體框架代碼首先FK場
public class Fighter
{
public int FighterID { get; set; }
public int DivsionID { get; set; }
public string Name { get; set; }
//...
public virtual Division Division { get; set; }
}
public class Division
{
public int DivisionID { get; set; }
public string Name { get; set; }
public int? FromWeight { get; set; }
public int? ToWeight { get; set; }
public ICollection<Fighter> Fighters { get; set; }
}
爲什麼我有Division_DivisionID我的戰士表?我認爲DevisionID應該是FK。
還有更多 - 他在屬性名稱中有一個拼寫錯誤('DivsionID'而不是'DivisionID') – 2012-07-30 13:07:22
@DiegoMijelshon你的絕對權利他也有一個拼寫錯誤,很好抓:) – 2012-07-30 20:04:58