This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
/
Northwind.vb
89 lines (85 loc) · 2.15 KB
/
Northwind.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Imports Microsoft.VisualBasic
Imports System
Imports DevExpress.Xpo
Namespace Northwind
Public Class Categories
Inherits XPBaseObject
Private fCategoryID As Integer
<Key(True)> _
Public Property CategoryID() As Integer
Get
Return fCategoryID
End Get
Set(ByVal value As Integer)
SetPropertyValue(Of Integer)("CategoryID", fCategoryID, value)
End Set
End Property
Private fCategoryName As String
<Size(15)> _
Public Property CategoryName() As String
Get
Return fCategoryName
End Get
Set(ByVal value As String)
SetPropertyValue(Of String)("CategoryName", fCategoryName, value)
End Set
End Property
<Association("Category-Products", GetType(Products))> _
Public ReadOnly Property Products() As XPCollection(Of Products)
Get
Return GetCollection(Of Products)("Products")
End Get
End Property
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Sub New()
MyBase.New(Session.DefaultSession)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
End Class
Public Class Products
Inherits XPLiteObject
Private fProductID As Integer
<Key(True)> _
Public Property ProductID() As Integer
Get
Return fProductID
End Get
Set(ByVal value As Integer)
SetPropertyValue(Of Integer)("ProductID", fProductID, value)
End Set
End Property
Private fProductName As String
<Size(40)> _
Public Property ProductName() As String
Get
Return fProductName
End Get
Set(ByVal value As String)
SetPropertyValue(Of String)("ProductName", fProductName, value)
End Set
End Property
Private fCategoryID As Categories
<Association("Category-Products")> _
Public Property CategoryID() As Categories
Get
Return fCategoryID
End Get
Set(ByVal value As Categories)
SetPropertyValue(Of Categories)("CategoryID", fCategoryID, value)
End Set
End Property
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Sub New()
MyBase.New(Session.DefaultSession)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
End Class
End Namespace