วันอาทิตย์ที่ 27 พฤศจิกายน พ.ศ. 2559

One-to-Many Relationship in Entity Framework

Public Class Student
    Public Property StudentId As Integer
    Public Property StudentName As String
    Public Property StdandardRefId As Integer
    <ForeignKey("StandardRefId")>
    Public Overridable Property Standard As Standard
End Class
 
Public Class Standard
    Public Sub New()
        Students = New List(Of Student)
    End Sub
    Public Property StandardId As Integer
    Public Property Description As String
    Public Overridable Property Students As ICollection(Of Student)
End Class



ไม่มีความคิดเห็น:

แสดงความคิดเห็น