I have a table with columns that are foreign keys to another table. There are multiple columns with links to the same foreign key table. I want to see an example view in which on create and edit I create new rows in the foreign key table and associate them on the same page with a new created record in the table with multiple columns referencing through foreign key constraint to the one table.
Now I want a single form in a view that creates records 3 records on the same page for Husband, Wife and Pastor records in the person table and also for DateOfMarriage, Church, ChurchAddress all fields on a single form page view.
I am working on trying to make such a view with controller the models and the model first database already exist and are correctly created.
This would be very helpful if you can provide an example that works.
Take a look at Getting Started with Entity Framework 6 Code First using MVC 5
Which uses FK’s.
Akshay Srinivasan commented
Have already got this working but not sure if I am doing it the best practice way.