0
|
1 using System;
|
|
2 using System.Data;
|
|
3
|
|
4 using BLToolkit.Data.Linq;
|
|
5 using BLToolkit.DataAccess;
|
|
6 using BLToolkit.Mapping;
|
|
7
|
|
8 using NUnit.Framework;
|
|
9
|
|
10 using BLToolkit.Data.DataProvider;
|
|
11
|
|
12 namespace Data.Linq.ProviderSpecific
|
|
13 {
|
|
14 [TestFixture]
|
|
15 public class SqlCe : TestBase
|
|
16 {
|
|
17 [TableName("LinqDataTypes")]
|
|
18 class Test
|
|
19 {
|
|
20 public int ID;
|
|
21 [MapField("DateTimeValue"), DbType(DbType.DateTime2)]
|
|
22 public DateTime? Data;
|
|
23 }
|
|
24
|
|
25 [Test]
|
|
26 public void DateTime2Test([IncludeDataContexts(ProviderName.SqlCe)] string context)
|
|
27 {
|
|
28 using (var db = new TestDbManager(context))
|
|
29 {
|
|
30 try
|
|
31 {
|
|
32 new SqlQuery<Test>().Insert(db, new Test { ID = 100001, Data = DateTime.Now });
|
|
33 }
|
|
34 finally
|
|
35 {
|
|
36 db.GetTable<Test>().Delete(t => t.ID > 10000);
|
|
37 }
|
|
38 }
|
|
39 }
|
|
40 }
|
|
41 }
|