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 PrimaryKey
|
|
12 {
|
|
13 public class Person
|
|
14 {
|
|
15 [MapField("PersonID"), /*[a]*/PrimaryKey/*[/a]*/, NonUpdatable]
|
|
16 public int ID;
|
|
17
|
|
18 public string LastName;
|
|
19 public string FirstName;
|
|
20 public string MiddleName;
|
|
21 }
|
|
22
|
|
23 [Test]
|
|
24 public void Test()
|
|
25 {
|
|
26 SqlQuery<Person> da = new SqlQuery<Person>();
|
|
27
|
|
28 Person person = da./*[a]*/SelectByKey(1)/*[/a]*/;
|
|
29
|
|
30 Assert.IsNotNull(person);
|
|
31 }
|
|
32 }
|
|
33 }
|
|
34
|