Skip to content
Permalink
Browse files

Tidy code

  • Loading branch information
asherber committed Oct 23, 2019
1 parent 7ca6c2b commit 5e714ce0a86c0a5f66e0f524b932087af9848e5f
Showing with 4 additions and 4 deletions.
  1. +4 −4 PetaPoco/Database.cs
@@ -607,16 +607,16 @@ private void SetParameterProperties(IDbDataParameter p, object value, PropertyIn
}
else if (t == typeof(AnsiString))
{
var asValue = value as AnsiString;
if (asValue.Value == null)
var asValue = (value as AnsiString).Value;
if (asValue == null)
{
p.Size = 0;
p.Value = DBNull.Value;
}
else
{
p.Size = Math.Max(asValue.Value.Length + 1, 4000);
p.Value = asValue.Value;
p.Size = Math.Max(asValue.Length + 1, 4000);
p.Value = asValue;
}
// Thanks @DataChomp for pointing out the SQL Server indexing performance hit of using wrong string type on varchar
p.DbType = DbType.AnsiString;

0 comments on commit 5e714ce

Please sign in to comment.
You can’t perform that action at this time.