diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/CodeFirst/SqlServerCodeFirst.cs b/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/CodeFirst/SqlServerCodeFirst.cs index 962763048..fcbe624e5 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/CodeFirst/SqlServerCodeFirst.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/CodeFirst/SqlServerCodeFirst.cs @@ -44,11 +44,11 @@ namespace SqlSugar else { var name = GetType(propertyType.Name); - if (name == "varbinary" && item.Length == 0) + result.DataType = this.Context.Ado.DbBind.GetDbTypeName(name); + if (result.DataType == "varbinary" && item.Length == 0) { - name = "varbinary(max)"; + result.DataType = "varbinary(max)"; } - result.DataType = this.Context.Ado.DbBind.GetDbTypeName(name); } } }