Reputation:
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.
Upvotes: 1
Views: 343
Reputation: 104999
EF1 is not that much different on the code side to EF4. There should be two properties:
Role
RoleReference
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.
Upvotes: 1
Reputation: 102368
You should have a Role property available. Check your relationship between Employee and Role. Rebuild the project.
Upvotes: 0