You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DbRepository class'Truncate methods do not handle the transaction argument correctly. A connection instance gets created even if transaction is not null, which leads to runtime issues.
public int Truncate<TEntity>(IDbTransaction transaction = null) where TEntity : class
{
// Create a connection
var connection = CreateConnection();
// Code removed for brevity
}
We should get the following implementation as it is done with the other DbRepository's operations:
public int Truncate<TEntity>(IDbTransaction transaction = null) where TEntity : class
{
// Create a connection
var connection = (transaction?.Connection ?? CreateConnection())
// Code removed for brevity
}
The text was updated successfully, but these errors were encountered:
zetomatoz
changed the title
[Bug] DbRepository's Truncate operations do not handle transactions
Bug: DbRepository's Truncate operations do not handle transactions
Mar 29, 2022
Thanks for reporting. It is a simple fix though. We are glad if you can also make a PR of this, otherwise we will do the fix and it will be a part of the release.
The
DbRepository
class'Truncate
methods do not handle the transaction argument correctly. Aconnection
instance gets created even iftransaction
is not null, which leads to runtime issues.We should get the following implementation as it is done with the other DbRepository's operations:
The text was updated successfully, but these errors were encountered: