Entity Framework 4.1 Code First - Define many-to-many using data annotations only
问题 Is it possible to define a many-to-many relationship in Entity Framework 4.1 (Code First approach) using Data Annotations only, without model builder? For example, something like: Product = { Id, Name, ... } Category = { Id, Name, ... } ProductCategory = { ProductId, CategoryId } You get the picture. I don't want to have an intermediate entity ProductCategory in the context with two many-to-ones since I don't have any additional data, just the two FKs. Also, I should be able to define table