Browse Source

Synchronization code

pull/25/head
sunkaixuan 2 years ago
parent
commit
3f39f1c828
  1. 2
      Src/Asp.NetCore2/SqlSugar/Abstract/DbBindProvider/DbBindProvider.cs
  2. 2
      Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs
  3. 2
      Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs
  4. 2
      Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/DbBind/SqlServerDbBind.cs

2
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")

2
Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs

@ -764,7 +764,7 @@ namespace SqlSugar
public DataTable ListToDataTable<T>(List<T> 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)

2
Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs

@ -81,7 +81,7 @@ namespace SqlSugar
new KeyValuePair<string, CSharpDataType>("boolean",CSharpDataType.@bool),
new KeyValuePair<string, CSharpDataType>("bool",CSharpDataType.@bool),
new KeyValuePair<string, CSharpDataType>("box",CSharpDataType.@bool),
new KeyValuePair<string, CSharpDataType>("bytea",CSharpDataType.@bool),
new KeyValuePair<string, CSharpDataType>("bytea",CSharpDataType.byteArray),
new KeyValuePair<string, CSharpDataType>("varchar",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("character varying",CSharpDataType.@string),

2
Src/Asp.NetCore2/SqlSugar/Realization/SqlServer/DbBind/SqlServerDbBind.cs

@ -62,8 +62,8 @@ namespace SqlSugar
new KeyValuePair<string, CSharpDataType>("smallint",CSharpDataType.@short),
new KeyValuePair<string, CSharpDataType>("tinyint",CSharpDataType.@byte),
new KeyValuePair<string, CSharpDataType>("uniqueidentifier",CSharpDataType.Guid),
new KeyValuePair<string, CSharpDataType>("binary",CSharpDataType.byteArray),
new KeyValuePair<string, CSharpDataType>("image",CSharpDataType.byteArray),
new KeyValuePair<string, CSharpDataType>("binary",CSharpDataType.byteArray),
new KeyValuePair<string, CSharpDataType>("varbinary",CSharpDataType.byteArray),
new KeyValuePair<string, CSharpDataType>("datetimeoffset", CSharpDataType.DateTimeOffset),
new KeyValuePair<string, CSharpDataType>("datetimeoffset", CSharpDataType.DateTime)};

Loading…
Cancel
Save