Skip to content

Commit

Permalink
Merge pull request #170 from tuespetre/master
Browse files Browse the repository at this point in the history
Fixed regression with sproc tests
  • Loading branch information
mgravell committed Sep 15, 2014
2 parents 1a935bd + 9ff6cd1 commit 9226076
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions Dapper NET40/SqlMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4397,16 +4397,22 @@ protected void AddParameters(IDbCommand command, SqlMapper.Identity identity)
// DynamicParameters until now.
foreach (IDbDataParameter param in command.Parameters)
{
parameters.Add(param.ParameterName, new ParamInfo
{
AttachedParam = param,
CameFromTemplate = true,
DbType = param.DbType,
Name = param.ParameterName,
ParameterDirection = param.Direction,
Size = param.Size,
Value = param.Value
});
// If someone makes a DynamicParameters with a template,
// then explicitly adds a parameter of a matching name,
// it will already exist in 'parameters'.
if (!parameters.ContainsKey(param.ParameterName))
{
parameters.Add(param.ParameterName, new ParamInfo
{
AttachedParam = param,
CameFromTemplate = true,
DbType = param.DbType,
Name = param.ParameterName,
ParameterDirection = param.Direction,
Size = param.Size,
Value = param.Value
});
}
}

// Now that the parameters are added to the command, let's place our output callbacks
Expand Down

0 comments on commit 9226076

Please sign in to comment.