I want to Map the relationships between my entities like this:
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; }
}
I wanted to make A 1 to 1 relationship from Profile class to other classes using just the Profile Id as the foreign instead of having all the id's of the related Classes. How would I do that using fluent Api?? I also need to have Resume => requires one Profile... How can I do that or is it possible??.