PageRenderTime 1047ms CodeModel.GetById 895ms app.highlight 2ms RepoModel.GetById 149ms app.codeStats 0ms

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