/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

  1. using System.Configuration;
  2. namespace Rhino.Etl.Tests.Integration
  3. {
  4. using System.Data;
  5. using Core;
  6. using Rhino.Etl.Core.Operations;
  7. public class WritePeople : OutputCommandOperation
  8. {
  9. public WritePeople() : base("test")
  10. {
  11. }
  12. public WritePeople(ConnectionStringSettings connectionStringSettings) : base(connectionStringSettings)
  13. {
  14. }
  15. protected override void PrepareCommand(IDbCommand cmd, Row row)
  16. {
  17. cmd.CommandText =
  18. @"INSERT INTO People (UserId, FirstName, LastName, Email) VALUES (@UserId, @FirstName, @LastName, @Email)";
  19. AddParameter("UserId", row["Id"]);
  20. AddParameter("FirstName", row["FirstName"]);
  21. AddParameter("LastName", row["LastName"]);
  22. AddParameter("Email", row["Email"]);
  23. }
  24. }
  25. }