Commit c645cb5f authored by Jesse's avatar Jesse

Make use the SqlMapper.Settings.CommandTimeout property as the default value...

Make use the SqlMapper.Settings.CommandTimeout property as the default value when the CommandDefinition commandTimeout property is not set.
parent 896cac19
...@@ -183,7 +183,13 @@ internal IDbCommand SetupCommand(IDbConnection cnn, Action<IDbCommand, object> p ...@@ -183,7 +183,13 @@ internal IDbCommand SetupCommand(IDbConnection cnn, Action<IDbCommand, object> p
cmd.Transaction = transaction; cmd.Transaction = transaction;
cmd.CommandText = commandText; cmd.CommandText = commandText;
if (commandTimeout.HasValue) if (commandTimeout.HasValue)
{
cmd.CommandTimeout = commandTimeout.Value; cmd.CommandTimeout = commandTimeout.Value;
}
else if (SqlMapper.Settings.CommandTimeout.HasValue)
{
cmd.CommandTimeout = SqlMapper.Settings.CommandTimeout.Value;
}
if (commandType.HasValue) if (commandType.HasValue)
cmd.CommandType = commandType.Value; cmd.CommandType = commandType.Value;
if (paramReader != null) if (paramReader != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment