Commit 056b22a5 authored by Marc Gravell's avatar Marc Gravell

Manually apply pull request #96 via olegKoshmeliuk

parent d68ec20e
...@@ -3389,7 +3389,7 @@ protected void AddParameters(IDbCommand command, SqlMapper.Identity identity) ...@@ -3389,7 +3389,7 @@ protected void AddParameters(IDbCommand command, SqlMapper.Identity identity)
{ {
p.Size = param.Size.Value; p.Size = param.Size.Value;
} }
if (dbType != null) if (dbType != null && p.DbType != dbType)
{ {
p.DbType = dbType.Value; p.DbType = dbType.Value;
} }
......
...@@ -2656,11 +2656,30 @@ public void TestDoubleDecimalConversions_SO18228523_Nulls() ...@@ -2656,11 +2656,30 @@ public void TestDoubleDecimalConversions_SO18228523_Nulls()
public void TestParameterInclusionNotSensitiveToCurrentCulture() public void TestParameterInclusionNotSensitiveToCurrentCulture()
{ {
CultureInfo current = Thread.CurrentThread.CurrentCulture; CultureInfo current = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR"); try
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
connection.Query<int>("select @pid", new { PId = 1 }).Single(); connection.Query<int>("select @pid", new { PId = 1 }).Single();
}
finally
{
Thread.CurrentThread.CurrentCulture = current;
}
}
Thread.CurrentThread.CurrentCulture = current; public void TestProcedureWithTimeParameter()
{
var p = new DynamicParameters();
p.Add("a", TimeSpan.FromHours(10), dbType: DbType.Time);
connection.Execute(@"CREATE PROCEDURE #TestProcWithTimeParameter
@a TIME
AS
BEGIN
SELECT @a
END");
connection.Query<TimeSpan>("#TestProcWithTimeParameter", p, commandType: CommandType.StoredProcedure).First().IsEqualTo(new TimeSpan(10, 0, 0));
} }
class HasDoubleDecimal class HasDoubleDecimal
......
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