comparison HowTo/DataAccess/ScalarFieldName.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
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 }