0
|
1 using System;
|
|
2 using System.Collections.Generic;
|
|
3
|
|
4 using NUnit.Framework;
|
|
5
|
|
6 using BLToolkit.DataAccess;
|
|
7
|
|
8 namespace HowTo.DataAccess
|
|
9 {
|
|
10 [TestFixture]
|
|
11 public class ScalarFieldName
|
|
12 {
|
|
13 public abstract class TestAccessor : DataAccessor
|
|
14 {
|
|
15 [SqlQuery("SELECT PersonID, FirstName FROM Person")]
|
|
16 [Index("PersonID")]
|
|
17 [/*[a]*/ScalarFieldName("FirstName")/*[/a]*/]
|
|
18 public abstract Dictionary<int, string> GetPersonNameDictionary();
|
|
19 }
|
|
20
|
|
21 [Test]
|
|
22 public void Test()
|
|
23 {
|
|
24 TestAccessor pa = DataAccessor.CreateInstance<TestAccessor>();
|
|
25
|
|
26 IDictionary<int, string> dic = pa.GetPersonNameDictionary();
|
|
27
|
|
28 Assert.AreEqual("John", dic[1]);
|
|
29 }
|
|
30 }
|
|
31 }
|