我有两个三个表,分别命名为
Language、Language Type、Employee
语言类型字段为LId,LanguageType
语言领域是LId,EmpId,Language Fluency
Employee 的字段是EmpId ,EmpName
语言类型和语言之间的关系是一对一的,语言和员工表是多对一的。问题是当我用语言输入数据时,它会显示错误
A dependent property in a Referential Constraint is mapped
to a store-generated column. Column: 'LId'."}.
即使数据被插入到语言类型而不是语言表中。lINQ 查询是针对语言表的
public void AddEmpLanguage(Language language, long id)
{
using (var context = new HRMSEntities())
{
Language emp = new Language
{
EmpId = id,
LanguageFluency = language.LanguageFluency,
};
context.Language.AddObject(emp);
}
}