예제 #1
0
파일: Database.cs 프로젝트: bnantz/NCS-V1-1
        /// <summary>
        /// <para>Assigns a <paramref name="connection"/> to the <paramref name="command"/> and discovers parameters if needed.</para>
        /// </summary>
        /// <param name="command"><para>The command that contains the query to prepare.</para></param>
        /// <param name="connection">The connection to assign to the command.</param>
        protected void PrepareCommand(DBCommandWrapper command, IDbConnection connection)
        {
            ArgumentValidation.CheckForNullReference(command, "command");
            ArgumentValidation.CheckForNullReference(connection, "connection");

            command.Command.Connection = connection;
            if (command.IsFurtherPreparationNeeded())
            {
                parameterCache.FillParameters(command, ParameterToken);
            }
        }