/
PersistentClasses1.cs
47 lines (46 loc) · 1.73 KB
/
PersistentClasses1.cs
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
using System;
using DevExpress.Xpo;
namespace Northwind {
public class Employees : XPLiteObject {
int fEmployeeID;
[Key(true)]
public int EmployeeID {
get { return fEmployeeID; }
set { SetPropertyValue<int>("EmployeeID", ref fEmployeeID, value); }
}
string fFirstName;
[Size(10)]
public string FirstName {
get { return fFirstName; }
set { SetPropertyValue<string>("FirstName", ref fFirstName, value); }
}
[Association("Employee-Orders", typeof(Orders))]
public XPCollection<Orders> Orders { get { return GetCollection<Orders>("Orders"); } }
public Employees(Session session) : base(session) { }
public Employees() : base(Session.DefaultSession) { }
public override void AfterConstruction() { base.AfterConstruction(); }
}
public class Orders : XPLiteObject {
int fOrderID;
[Key(true)]
public int OrderID {
get { return fOrderID; }
set { SetPropertyValue<int>("OrderID", ref fOrderID, value); }
}
Employees fEmployeeID;
[Association("Employee-Orders")]
public Employees EmployeeID {
get { return fEmployeeID; }
set { SetPropertyValue<Employees>("EmployeeID", ref fEmployeeID, value); }
}
string fShipCity;
[Size(15)]
public string ShipCity {
get { return fShipCity; }
set { SetPropertyValue<string>("ShipCity", ref fShipCity, value); }
}
public Orders(Session session) : base(session) { }
public Orders() : base(Session.DefaultSession) { }
public override void AfterConstruction() { base.AfterConstruction(); }
}
}