I have a client needs to be able to create candidates. Candidates can have many qualifications (qualifications is model with 4 properties). The client needs to be able to add N numbers of qualifications to the employee on the creation page.
View Model
public class CreateCandidateViewModel
{
[DisplayName("First Name"), Required]
public string FirstName { get; set; }
[DisplayName("Last Name"), Required]
public string LastName { get; set; }
[DisplayName("Email Address"), Required]
public string Email { get; set; }
[DisplayName("Phone Number"), Required]
public string Phone { get; set; }
[DisplayName("Zip Code"), Required]
public int ZipCode { get; set; }
public List<Qualification> Qualifications { get; set; }
}
Qualification Model
public class Qualification
{
[Key]
public int Id { get; set; }
public int QualificationTypeId { get; set; }
public string Name { get; set; }
public DateTime DateStarted { get; set; }
public DateTime DateCompleted { get; set; }
[ForeignKey("QualificationTypeId")]
public virtual QualificationType Type { get; set; }
}
I have no idea how to approach this problem. I was thinking of creating the candidate first and then sending the client to another view where the client can add qualifications and so on.