diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/DbBindProvider/DbBindProvider.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/DbBindProvider/DbBindProvider.cs index aa797e00c..1cb6ea982 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/DbBindProvider/DbBindProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/DbBindProvider/DbBindProvider.cs @@ -19,7 +19,7 @@ namespace SqlSugar public virtual string GetDbTypeName(string csharpTypeName) { if (csharpTypeName == UtilConstants.ByteArrayType.Name) - return "varbinary"; + return "bytea"; if (csharpTypeName.ToLower() == "int32") csharpTypeName = "int"; if (csharpTypeName.ToLower() == "int16") diff --git a/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs index 643da1ce7..853901561 100644 --- a/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs @@ -764,7 +764,7 @@ namespace SqlSugar public DataTable ListToDataTable(List list) { DataTable result = new DataTable(); - if (list.Count > 0) + if (list!=null&&list.Count > 0) { PropertyInfo[] propertys = list[0].GetType().GetProperties(); foreach (PropertyInfo pi in propertys) diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs b/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs index ab27df1b9..7e4323238 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs @@ -81,7 +81,7 @@ namespace SqlSugar new KeyValuePair("boolean",CSharpDataType.@bool), new KeyValuePair("bool",CSharpDataType.@bool), new KeyValuePair("box",CSharpDataType.@bool), - new KeyValuePair("bytea",CSharpDataType.@bool), + new KeyValuePair("bytea",CSharpDataType.byteArray), new KeyValuePair("varchar",CSharpDataType.@string), new KeyValuePair("character varying",CSharpDataType.@string), diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/DbBind/SqlServerDbBind.cs b/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/DbBind/SqlServerDbBind.cs index 54a63c067..94e94f06e 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/DbBind/SqlServerDbBind.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/DbBind/SqlServerDbBind.cs @@ -62,8 +62,8 @@ namespace SqlSugar new KeyValuePair("smallint",CSharpDataType.@short), new KeyValuePair("tinyint",CSharpDataType.@byte), new KeyValuePair("uniqueidentifier",CSharpDataType.Guid), - new KeyValuePair("binary",CSharpDataType.byteArray), new KeyValuePair("image",CSharpDataType.byteArray), + new KeyValuePair("binary",CSharpDataType.byteArray), new KeyValuePair("varbinary",CSharpDataType.byteArray), new KeyValuePair("datetimeoffset", CSharpDataType.DateTimeOffset), new KeyValuePair("datetimeoffset", CSharpDataType.DateTime)};