Skip to content

Commit

Permalink
Merge pull request #74 from nuetzliches/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
fen89 authored Nov 3, 2022
2 parents bc1619a + c28184a commit acc167e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Output-v5-0/DataContext/SqlParameterExtensions.base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static IEnumerable<SqlDataRecord> ToSqlParamCollection<T>(this T value)
var propName = property.Name;
var sqlType = AppDbContext.GetSqlDbType(property.PropertyType);

if (sqlType == SqlDbType.NVarChar)
if (sqlType == SqlDbType.NVarChar || sqlType == SqlDbType.VarBinary)
{
var maxLengthAttribute = (MaxLengthAttribute)property.GetCustomAttributes(typeof(MaxLengthAttribute), false).FirstOrDefault();
if (maxLengthAttribute != null)
Expand Down Expand Up @@ -115,4 +115,4 @@ public static IEnumerable<SqlDataRecord> ToSqlParamCollection<T>(this T value)
return result;
}
}
}
}
4 changes: 2 additions & 2 deletions src/Output/DataContext/SqlParameterExtensions.base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static IEnumerable<SqlDataRecord> ToSqlParamCollection<T>(this T value)
var propName = property.Name;
var sqlType = AppDbContext.GetSqlDbType(property.PropertyType);

if (sqlType == SqlDbType.NVarChar)
if (sqlType == SqlDbType.NVarChar || sqlType == SqlDbType.VarBinary)
{
var maxLengthAttribute = (MaxLengthAttribute)property.GetCustomAttributes(typeof(MaxLengthAttribute), false).FirstOrDefault();
if (maxLengthAttribute != null)
Expand Down Expand Up @@ -115,4 +115,4 @@ public static IEnumerable<SqlDataRecord> ToSqlParamCollection<T>(this T value)
return result;
}
}
}
}

0 comments on commit acc167e

Please sign in to comment.