0
|
1 using System;
|
|
2 using System.Linq;
|
|
3
|
|
4 using BLToolkit.Data;
|
|
5 using BLToolkit.Data.Linq;
|
|
6 using BLToolkit.DataAccess;
|
|
7 using BLToolkit.Mapping;
|
|
8
|
|
9 using NUnit.Framework;
|
|
10
|
|
11 namespace Data.Linq.UserTests
|
|
12 {
|
|
13 [TestFixture]
|
|
14 public class CompareNullableChars : TestBase
|
|
15 {
|
|
16 class Table1
|
|
17 {
|
|
18 [PrimaryKey(1)]
|
|
19 [Identity] public Int64 Field1 { get; set; }
|
|
20 [Nullable] public Char? Foeld2 { get; set; }
|
|
21 }
|
|
22
|
|
23 class Repository : DbManager
|
|
24 {
|
|
25 public Repository(string configurationString) : base(configurationString)
|
|
26 {
|
|
27 }
|
|
28
|
|
29 public Table<Table1> Table1 { get { return this.GetTable<Table1>(); } }
|
|
30 }
|
|
31
|
|
32 [Test]
|
|
33 public void Test([DataContexts(ExcludeLinqService=true)] string context)
|
|
34 {
|
|
35 using (var db = new Repository(context))
|
|
36 {
|
|
37 var q =
|
|
38 from current in db.Table1
|
|
39 from previous in db.Table1
|
|
40 where current.Foeld2 == previous.Foeld2
|
|
41 select new { current.Field1, Field2 = previous.Field1 };
|
|
42
|
|
43 var sql = q.ToString();
|
|
44 }
|
|
45 }
|
|
46 }
|
|
47 }
|