/Rhino.Etl.Core/ConventionOperations/ConventionSqlBatchOpeartion.cs

http://github.com/ayende/rhino-etl · C# · 42 lines · 22 code · 4 blank · 16 comment · 0 complexity · 0cdee6a3c0f97df2d09ea82c4b8e9eec MD5 · raw file

  1. namespace Rhino.Etl.Core.ConventionOperations
  2. {
  3. using System.Data.SqlClient;
  4. using Operations;
  5. /// <summary>
  6. /// Convention class for sql batching.
  7. /// </summary>
  8. public class ConventionSqlBatchOpeartion : SqlBatchOperation
  9. {
  10. private string command;
  11. /// <summary>
  12. /// Gets or sets the command text to execute
  13. /// </summary>
  14. /// <value>The command.</value>
  15. public string Command
  16. {
  17. get { return command; }
  18. set { command = value; }
  19. }
  20. /// <summary>
  21. /// Initializes a new instance of the <see cref="ConventionSqlBatchOpeartion"/> class.
  22. /// </summary>
  23. /// <param name="connectionStringName">Name of the connection string.</param>
  24. public ConventionSqlBatchOpeartion(string connectionStringName) : base(connectionStringName)
  25. {
  26. }
  27. /// <summary>
  28. /// Prepares the command.
  29. /// </summary>
  30. /// <param name="row">The row.</param>
  31. /// <param name="sqlCommand">The SQL command.</param>
  32. protected override void PrepareCommand(Row row, SqlCommand sqlCommand)
  33. {
  34. sqlCommand.CommandText = Command;
  35. CopyRowValuesToCommandParameters(sqlCommand, row);
  36. }
  37. }
  38. }