We use the preliminary version of EF5 and first make the code. I have a Orders model and a Products model (many, many). I created an OrderItems model with OrderID, ProductId, and Quantity fields. This is not automatic link table creation. Below is the code:
Imports System.ComponentModel.DataAnnotations
Public Class OrderItems
Public Property OrderID As Long
Public Property ProductID As Long
Public Property Quantity As Integer
End Class
Do I need to comment on them as mandatory or link them explicitly using the Association tag?
source
share