Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • So you mean there is nothing additional thing to do to set the relationship? Commented Jul 7, 2014 at 8:14
  • you need to understand the convention, but if you want different name as navigation property you can use ForeignKey attribute or FluentApi Commented Jul 7, 2014 at 8:17
  • the convention fits your requirement, so yes, there is nothing to set up Commented Jul 7, 2014 at 8:20
  • How does it know thaat? Categories_CategoryId is same as the Id of categories? Thanks. Commented Jul 7, 2014 at 8:30
  • 1
    in this case by adding Category::Products(array) creates the relationship, if you don't have Product::CategoryId, then EF will create Category_Id column in Products table Commented Jul 7, 2014 at 8:44