My table:
Employee
--------
Name
Age
Role int (foreign key)
How can I assign a te开发者_运维技巧xtbox value to the Role column?
In Entity Framework 4 I would go:
Employee x = new Employee()
x.Role = textBox1.Text;
It seems I don't have the Role columns available to me.
Thanks.
EF1 is not that much different on the code side to EF4. There should be two properties:
RoleRoleReference
In your case, you'd be setting primary key value of the latter one to avoid loading the whole Role entity.
So if you really don't see any of these, then your project maybe didn't compile and you're still looking at some older version of it, that doesn't have the Role relationship.
You should have a Role property available. Check your relationship between Employee and Role. Rebuild the project.
加载中,请稍侯......
精彩评论