PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Rhino.Etl.Tests/Integration/WritePeople.cs

http://github.com/ayende/rhino-etl
C# | 29 lines | 25 code | 4 blank | 0 comment | 0 complexity | 0a337ed2df68d26a3118b07e7ea61d76 MD5 | raw file
 1using System.Configuration;
 2
 3namespace Rhino.Etl.Tests.Integration
 4{
 5    using System.Data;
 6    using Core;
 7    using Rhino.Etl.Core.Operations;
 8
 9    public class WritePeople : OutputCommandOperation
10    {
11        public WritePeople() : base("test")
12        {
13        }
14
15        public WritePeople(ConnectionStringSettings connectionStringSettings) : base(connectionStringSettings)
16        {
17        }
18
19        protected override void PrepareCommand(IDbCommand cmd, Row row)
20        {
21            cmd.CommandText =
22                @"INSERT INTO People (UserId, FirstName, LastName, Email) VALUES (@UserId, @FirstName, @LastName, @Email)";
23            AddParameter("UserId", row["Id"]);
24            AddParameter("FirstName", row["FirstName"]);
25            AddParameter("LastName", row["LastName"]);
26            AddParameter("Email", row["Email"]);
27        }
28    }
29}