0
|
1 using System;
|
|
2
|
|
3 using NUnit.Framework;
|
|
4
|
|
5 using BLToolkit.DataAccess;
|
|
6 using BLToolkit.Mapping;
|
|
7
|
|
8 namespace HowTo.DataAccess
|
|
9 {
|
|
10 [TestFixture]
|
|
11 public class TableName
|
|
12 {
|
|
13 /*[a]*/[TableName("Person")]/*[/a]*/
|
|
14 public class /*[a]*/MyPersonObject/*[/a]*/
|
|
15 {
|
|
16 [MapField("PersonID"), PrimaryKey, NonUpdatable]
|
|
17 public int ID;
|
|
18
|
|
19 public string LastName;
|
|
20 public string FirstName;
|
|
21 public string MiddleName;
|
|
22 }
|
|
23
|
|
24 [Test]
|
|
25 public void Test1()
|
|
26 {
|
|
27 SqlQuery<MyPersonObject> query = new SqlQuery<MyPersonObject>();
|
|
28
|
|
29 MyPersonObject person = query./*[a]*/SelectByKey(1)/*[/a]*/;
|
|
30
|
|
31 Assert.IsNotNull(person);
|
|
32 }
|
|
33
|
|
34 [Test]
|
|
35 public void Test2()
|
|
36 {
|
|
37 SprocQuery<MyPersonObject> query = new SprocQuery<MyPersonObject>();
|
|
38
|
|
39 MyPersonObject person = query./*[a]*/SelectByKey(1)/*[/a]*/;
|
|
40
|
|
41 Assert.IsNotNull(person);
|
|
42 }
|
|
43 }
|
|
44 }
|
|
45
|