Own table for an Entity Framework 4 one-to-many association
I'm using the model-first approach offered by the EF4. I have two entities: User and Feature. As you would imagine, a User has a collection of Feature. After modeling this association and generating the SQL, the result is that the table Feature has a FK to User. What I want is to have the E开发者_如何学编程F generate another table UserFeatures to store the relationships. Is there a way to do this without modeling the UserFeatures entity?
EF will create such table only if you want to model M:N relation. There is no reason to have such table for 1:N and EF don't generate it unless you somehow model it in designer.
精彩评论