I am creating a simple application where users can log notifications
For the Create View where a user logs a Notification I want the user to fill in the details of the Notification and then also have an input section to add multiple GeneratingJobs for the notification (a Many-to-Many relationship) and then when the user submits the notification, the Notification gets logged along with the GeneratingJobs in a many-to-many relationship.
Entity Relationship
- Notification (*Many) <---> (*Many) GeneratingJob
- Notification (*Many) <---> (1One) Reporter
Can anyone help?
In my model I have:
Notification Class (contains details about the Notification, such as Description, DateSubmitted etc)
public class Notification
{
public int ID { get; set; }
public string Title { get; set; }
public string Description_of_Symptoms { get; set; }
public string Additional_Information { get; set; }
public DateTime Submitted_Date { get; set; }
public int Occurrences { get; set; }
public string ReporterWindowsIdentity { get; set; }
public virtual Reporter Reporter { get; set; }
public virtual ICollection<GeneratingJob> GeneratingJobs { get; set; }
}
Reporter Class (contains information about the user logging the Notification)
public class Reporter
{
[Key]
public string WindowsIdentity { get; set; }
public string Firstname { get; set; }
public string Surname { get; set; }
public virtual ICollection<Notification> Notifications { get; set; }
}
GeneratingJob Class (contains information about the Job that generated the Notification)
public class GeneratingJob
{
public int Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public int GeneratingJobPriorityId { get; set; }
public virtual ICollection<Notification> Notifications { get; set; }
public virtual GeneratingJobPriority GeneratingJobPriority { get; set; }
}
GeneratingJobPriority Class (contains information about the Job that generated the Notification's priority)
public class GeneratingJobPriority
{
public int Id { get; set; }
public string Priority { get; set; }
public virtual ICollection<GeneratingJob> GeneratingJobs { get; set; }
}