I am not the most fluent with ASP.NET/EF, so I am having a bit of a hard time trying to find the best way to accomplish what I need to get done. I'm trying to create a CRUD with an already existing database.
Instead of the Employees table having specific columns for contact information, they designed it to link to the Contact_Info table with Contact_Links being the middle-man.
I have 3 tables:
Employee
Columns: EmployeeID (PK), FirstName, LastName
Employee Links to Contact Links via Contact_ID=EmployeeID
Contact_Links
Columns: ID (PK), Contact_ID (FK), Contact_Info_ID (FK), Type
Contact_Links links to Contact_Info via Contact_Info_ID=ID
Contact_Info
Columns: ID (PK), Data
The type column in Contact_Links determines whether it's an email address, cell phone, fax, etc. So its actually more than just a PK/FK table.
Maybe the easiest way would be to have an Action Method create an Employee first, then in the details page of an option to add a Contact Info item? I'm not sure where to begin in mapping this out.
Any suggestions on what would be the best approach to do what I'm trying would be GREATLY appreciated!