我要地圖我的實體之間的關係是這樣的:生成關係單個鍵
public partial class Profile {
[Key]
public int ProfileId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string MiddleName { get; set; }
public string Gender { get; set; }
public string DateOfBirth { get; set; }
public int Age { get; set; }
public string CivilStatus { get; set; }
public string Email { get; set; }
public string Telephone { get; set; }
public string Mobile { get; set; }
public string City { get; set; }
public string District { get; set; }
public string Province { get; set; }
public string Region { get; set; }
public int Zip { get; set; }
public virtual Application Application { get; set; }
public virtual Education Education { get; set; }
public virtual Identification Identification { get; set; }
public virtual Job Job { get; set; }
public virtual Resume Resume { get; set; }
}
public partial class Resume {
public int ResumeId { get; set; }
public int ProfileId { get; set; }
public string ResumeFile { get; set; }
public virtual Profile Profile { get; set; }
}
public partial class Job
{
public int JobId { get; set; }
public int ProfileId { get; set; }
public string PreviousCompany { get; set; }
public string InclusiveDate { get; set; }
public string Position { get; set; }
public virtual Profile Profile { get; set; }
}
public partial class Education
{
public int EducationId { get; set; }
public int ProfileId { get; set; }
public string School { get; set; }
public string EducationLevel { get; set; }
public string YearGraduated { get; set; }
public string Degree { get; set; }
public virtual Profile Profile { get; set; }
}
我想作一個1比1從檔案類只使用個人資料的ID作爲其他類的關係而不是擁有相關類的所有id。我將如何使用流利Api?我還需要Resume =>需要一個配置文件...我該怎麼做,或者有可能嗎?
你想將每個類映射到單獨的表中,還是要將所有類映射到一個表中? – Andrey
我想將他們映射到配置文件表..要像這樣profile.Job –