My table:
Employee
--------
Name
Age
Role int (foreign key)
How can I assign a textbox 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:
RoleRoleReferenceIn your case, you’d be setting primary key value of the latter one to avoid loading the whole
Roleentity.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
Rolerelationship.