程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> 關於C語言 >> C#基礎系列:實現自己的ORM(MiniORM的測試代碼)(3)

C#基礎系列:實現自己的ORM(MiniORM的測試代碼)(3)

編輯:關於C語言

測試代碼如下:

下面是類代碼:

1.[DataObjectAttribute("Person", "ID", "")]
2.public class Person
3.{
4. private int _ID;
5. private string _Name;
6. private int _Age;
7. private string _Sex;
8. private Head _Head;
9. private Hand _LeftHand;
10. private Hand _RightHand;
11.
12. [DataFIEldAttribute("ID", true)]
13. public int ID
14. {
15. get { return _ID; }
16. set { _ID = value; }
17. }
18.
19. [SubDataObjectAttribute(SubDataObjectFIEldType.Object, "MiniORM", "MiniORM", "Head")]
20. public Head Head
21. {
22. get { return _Head; }
23. set { _Head = value; }
24. }
25.
26. [SubDataObjectAttribute(SubDataObjectFIEldType.Object, "MiniORM", "MiniORM", "Hand")]
27. public Hand LeftHand
28. {
29. get { return _LeftHand; }
30. set { _LeftHand = value; }
31. }
32.
33. [SubDataObjectAttribute(SubDataObjectFIEldType.Object, "MiniORM", "MiniORM", "Hand")]
34. public Hand RightHand
35. {
36. get { return _RightHand; }
37. set { _RightHand = value; }
38. }
39.
40. [DataFIEldAttribute("name", "NvarChar")]
41. public string Name
42. {
43. get { return this._Name; }
44. set { this._Name = value; }
45. }
46.
47. [DataFIEldAttribute("age", "int")]
48. public int Age
49. {
50. get { return this._Age; }
51. set { this._Age = value; }
52. }
53.
54. [DataFIEldAttribute("sex", "NvarChar")]
55. public string Sex
56. {
57. get { return this._Sex; }
58. set { this._Sex = value; }
59. }
60.
61. public Hand Hand
62. {
63. get
64. {
65. throw new System.NotImplementedException();
66. }
67. set
68. {
69. }
70. }
71.
72. public Head Head1
73. {
74. get
75. {
76. throw new System.NotImplementedException();
77. }
78. set
79. {
80. }
81. }
82.}
83.
84.[DataObjectAttribute("Hand", "ID", "PersonID")]
85.public class Hand
86.{
87. private int _ID;
88. private int _PersonID;
89. private string _Name;
90.
91. [DataFIEldAttribute("ID", true)]
92. public int ID
93. {
94. get { return this._ID; }
95. set { this._ID = value; }
96. }
97.
98. [DataFIEldAttribute("PersonID")]
99. public int PersonID
100. {
101. get { return this._PersonID; }
102. set { this._PersonID = value; }
103. }
104.
105. [DataFIEldAttribute("name", "NvarChar")]
106. public string Name
107. {
108. get { return _Name; }
109. set { _Name = value; }
110. }
111.}
112.
113.[DataObjectAttribute("Head", "ID", "PersonID")]
114.public class Head
115.{
116. private int _ID;
117. private int _PersonID;
118. private string _Name;
119.
120. [DataFIEldAttribute("ID", true)]
121. public int ID
122. {
123. get { return this._ID; }
124. set { this._ID = value; }
125. }
126.
127. [DataFIEldAttribute("PersonID")]
128. public int PersonID
129. {
130. get { return this._PersonID; }
131. set { this._PersonID = value; }
132. }
133.
134. [DataFIEldAttribute("name", "NvarChar")]
135. public string Name
136. {
137. get { return _Name; }
138. set { _Name = value; }
139. }
140.}
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved