예제 #1
0
            /// <summary>
            /// Creates an ADO command initialised with the specified connection
            /// and command text. This uses the default command type.
            /// </summary>
            public DbCommand CreateCommand(DbConnection dbConnection, String commandText)
            {
                if (innerResourceProvider == null)
                {
                    throw new NotSupportedException(RM.Get_Error_ResourceProviderNotInitialised());
                }

                return(associateCommandWithTransaction(
                           innerResourceProvider.CreateCommand(dbConnection,
                                                               commandText)));
            }
예제 #2
0
        /// <summary>
        /// Insert a new completed scope into the persistence store.
        /// </summary>
        /// <param name="instanceId"></param>
        /// <param name="scopeId"></param>
        /// <param name="state"></param>
        public void InsertCompletedScope(Guid instanceId, Guid scopeId, byte[] state)
        {
            using (DbCommand dbCommand = resourceProvider.CreateCommand(dbConnection, nameResolver.ResolveCommandName(CommandNames.InsertCompletedScope), CommandType.StoredProcedure))
            {
                resourceProvider.AddParameter(dbCommand,
                                              nameResolver.ResolveParameterName(CommandNames.InsertCompletedScope,
                                                                                ParameterNames.InstanceId), instanceId, AdoDbType.Guid);

                resourceProvider.AddParameter(dbCommand,
                                              nameResolver.ResolveParameterName(CommandNames.InsertCompletedScope,
                                                                                ParameterNames.ScopeId), scopeId, AdoDbType.Guid);

                resourceProvider.AddParameter(dbCommand,
                                              nameResolver.ResolveParameterName(CommandNames.InsertCompletedScope,
                                                                                ParameterNames.State), state, AdoDbType.Binary);

                dbCommand.ExecuteNonQuery();
            }
        }
예제 #3
0
 /// <summary>
 /// Thin wrapper around
 /// <see cref="IAdoResourceProvider.CreateCommand(DbConnection,string)" />
 /// that provides the connection to use for derived implementations.
 /// </summary>
 protected DbCommand CreateCommand(String commandText)
 {
     return(_resourceProvider.CreateCommand(_dbConnection, commandText));
 }
예제 #4
0
 /// <summary>
 /// Thin wrapper around
 /// <see cref="IAdoResourceProvider.CreateCommand(DbConnection,string)" />
 /// that provides the connection to use for derived implementations.
 /// </summary>
 protected DbCommand CreateCommand(string commandText)
 {
     return(resourceProvider.CreateCommand(this.dbConnection, commandText));
 }