kCura.Data.RowDataGateway.Helper
Closes the provided DbDataReader.
public static Exception CombineExceptions(Exception finalException, IEnumerable<Exception> otherExceptions)
Creates a deadlock exception based on the final exception and the other
exceptions that occurred while retrying the deadlock.
public static void DeleteFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID)
Deletes from the provided table the artifact id if it exists in the provided foreign key id column.
public static void DeleteFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID, string prefix)
Deletes from the provided table the artifact id if it exists in the provided foreign key id column.
public static void DeleteFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID, bool checkTableExistence)
Deletes from the provided table the artifact id if it exists in the provided foreign key id column.
public static void DeleteFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID, bool checkTableExistence, string prefix)
Deletes from the provided table the artifact id if it exists in the provided foreign key id column.
public static void DeleteFromTableByForeignKeyIDs(BaseContext context, string tableName, string foreignKeyID1Name, int foreignKeyID1, string foreignKeyID2Name, int foreignKeyID2)
public static void DeleteFromTableByForeignKeyValue(BaseContext context, string tableName, string foreignKeyValueName, string foreignKeyValue)
public static void DeleteMultipleFromTableByForeignKeyGuid(BaseContext context, string tableName, string foreignKeyIDName, List<Guid> foreignKeyIDs, string prefix = "")
Deletes the rows corresponding to the provided guid(s) if they exists in the provided foreign key id column of the provided table.
public static void DeleteMultipleFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, string commaSeparatedListOfIDs)
Deletes the rows corresponding to the provided artifact id(s) if they exists in the provided foreign key id column of the provided table.
public static void DeleteMultipleFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, string commaSeparatedListOfIDs, int timeoutValue)
Deletes the rows corresponding to the provided artifact id(s) if they exists in the provided foreign key id column of the provided table.
public static int ExecuteNonQuerySQLStatementRemotely(string sqlStatement, IEnumerable<SqlParameter> parameters, BaseContext context, RemoteDatabaseContext remoteDbContext)
Executes a SQL statement against a remote SQL server that does not return data, using the provided set of parameters, context, and remote context. Uses ConnectTimeout as its timeout.
public static int ExecuteNonQuerySQLStatementRemotely(string sqlStatement, IEnumerable<SqlParameter> parameters, int timeoutValue, BaseContext context, RemoteDatabaseContext remoteDbContext)
Executes a SQL statement against a remote SQL server that does not return data, using the provided set of parameters, timeout, context, and remote context.
Attempts to execute the specified command and retries up to NumberOfTriesOnDeadlock
times if the command errors out with a deadlock error. Note that this
method should not be used for any command used in the scope of a transaction
as the transaction is abandoned after a deadlock is encountered.
public static Task<int> ExecuteNonSqlQueryRetryOnDeadlockAsync(Func<Task<int>> func, CancellationToken cancelToken)
Executes the provided function NumberOfTriesOnDeadlock times, using the provided cancellation token.
public static bool ExistsByForeignKey(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID)
Fills the data table using the data adapter.
The data adapter should not have a transaction as the transaction is abandoned after a deadlock is encountered.
Attempts to execute the specified command to fill the provided
dataSet with the provided dataAdapter
and retries up to NumberOfTriesOnDeadlock
times if the command errors out with a deadlock error. Note that this
data adapter should not be used for any command used in the scope of a transaction
as the transaction is abandoned after a deadlock is encountered.
Wraps RemoteDatabasePrependString, using the server and database name of the provided RemoteDatabaseContext.
public static string GetRemoteDatabasePrepend(string serverName, RemoteDatabaseContext remoteDbContext)
Gets the remote database prepend to use for sql commands against the provided server with the provided RemoteDatabaseContext.
Wraps RemoteDatabasePrependStringForDboUser, using the server and database name of the provided RemoteDatabaseContext.
public static string GetSchemaLessRemoteDatabasePrepend(string serverName, RemoteDatabaseContext remoteDbContext)
Gets the remote database prepend without a schema to be used for sql commands against the provided server with the provided RemoteDatabaseContext.
Indicates whether the provided exception indicates a deadlock scenario.
public static void RemoveFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID, string prefix = "")
Updates, to null, the row corresponding to the provided artifact id if it exists in the provided foreign key id column of the provided table.
Attempts to cast the provided value to DBNull. If that fails, attempts to cast the provided value to a Guid.