diff --git a/src/Output-v5-0/DataContext/SqlParameterExtensions.base.cs b/src/Output-v5-0/DataContext/SqlParameterExtensions.base.cs index d0a396c..1f8bc2e 100644 --- a/src/Output-v5-0/DataContext/SqlParameterExtensions.base.cs +++ b/src/Output-v5-0/DataContext/SqlParameterExtensions.base.cs @@ -38,7 +38,7 @@ public static IEnumerable ToSqlParamCollection(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) @@ -115,4 +115,4 @@ public static IEnumerable ToSqlParamCollection(this T value) return result; } } -} \ No newline at end of file +} diff --git a/src/Output/DataContext/SqlParameterExtensions.base.cs b/src/Output/DataContext/SqlParameterExtensions.base.cs index d0a396c..1f8bc2e 100644 --- a/src/Output/DataContext/SqlParameterExtensions.base.cs +++ b/src/Output/DataContext/SqlParameterExtensions.base.cs @@ -38,7 +38,7 @@ public static IEnumerable ToSqlParamCollection(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) @@ -115,4 +115,4 @@ public static IEnumerable ToSqlParamCollection(this T value) return result; } } -} \ No newline at end of file +}