Hi Guys I have an mvc web application in the model i have driver model and Contact model i have created a contact property in the Driver model as i want to save only names and few things but the contact model is used by other model as well. i have created a DriverController in which i want to save details entered by user including details for the driver first name , ...etc as well as some data for the contact model including address details, the issue is when i try to access the contact information from the driver property fo it in the Driver model i couldn't access ant but i was able to acces it from the view! the first question how i would be able to do that? the second question is how do i save both at the same time into database bare in mind that Contact model got a driverID as a foreignkey so i need to be able the newly created DriverID from driver(automatically generated) to contact table I'm using MVC4 and EF6
here is my controller