I'm using ASP.net MVC an I have simplified but made the following models
public class Employee
{
public int Id { get; set; }
public string EmpName { get; set; }
}
public class Customer
{
public int Id { get; set; }
public string CusName { get; set; }
}
public class Task
{
public int Id { get; set; }
public DateTime StartDate{ get; set; }
public DateTime? EndDate{ get; set; }
}
An Employee can have many Tasks. A Task can have Many Employees (but only at any one time) A Customer can have Many Tasks
What I'm struggling with is being able to record not when the Task starts or finishes, but when the relationship between the Employee and the Task starts and ends and a new Employee starts. I know I will need a History entity but I cannot think how I would record this. By the way, if the task ends from the Customers point of view the relationship between the Employee and the task automatically ends.
Thank you as always. If anybody has any pointers for good books or video tutorials on EF that deal with this kind of relationship it would be much appreciated.