0
|
1 using System;
|
|
2
|
|
3 using NUnit.Framework;
|
|
4
|
|
5 using BLToolkit.Data;
|
|
6 using BLToolkit.DataAccess;
|
|
7
|
|
8 namespace HowTo.DataAccess
|
|
9 {
|
|
10 [TestFixture]
|
|
11 public class InsertSql
|
|
12 {
|
|
13 [Test]
|
|
14 public void Test1()
|
|
15 {
|
|
16 /*[a]*/SqlQuery<Person> query = new SqlQuery<Person>()/*[/a]*/;
|
|
17
|
|
18 Person person = new Person();
|
|
19
|
|
20 person.FirstName = "Crazy";
|
|
21 person.LastName = "Frog";
|
|
22 person.Gender = Gender.Unknown;
|
|
23
|
|
24 query./*[a]*/Insert(person)/*[/a]*/;
|
|
25 }
|
|
26
|
|
27 [Test]
|
|
28 public void Test2()
|
|
29 {
|
|
30 using (DbManager db = new DbManager())
|
|
31 {
|
|
32 /*[a]*/SqlQuery<Person> query = new SqlQuery<Person>()/*[/a]*/;
|
|
33
|
|
34 Person person = new Person();
|
|
35
|
|
36 person.FirstName = "Crazy";
|
|
37 person.LastName = "Frog";
|
|
38 person.Gender = Gender.Other;
|
|
39
|
|
40 query./*[a]*/Insert(db, person)/*[/a]*/;
|
|
41 }
|
|
42 }
|
|
43 }
|
|
44 }
|
|
45
|