I am getting this error when I try to do an insert on a column that is a foreign key. Here is how I am assigning the value
var at = MvcApplication1.Entity.alttitles.Createalttitles(0, altTitleText);
at.question.question_id = questionid; //Error here
at.userinfo.user_userid = _AuthorID; //Error here
context.AddToalttitles(at);
res = context.SaveChanges();
When I made the question_id and the userid a foreign key I started getting this error. Is there a way to fix this?