Browse Source

Insertable Updateable Dictionary BUG

pull/12/MERGE
610262374@qq.com 6 years ago
parent
commit
291f2fe2d8
  1. 6
      Src/Asp.Net/SqlServerTest/Config.cs
  2. 3
      Src/Asp.Net/SqlServerTest/Demos/2_Update.cs
  3. 1
      Src/Asp.Net/SqlServerTest/Demos/3_Insert.cs
  4. 2
      Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs
  5. 2
      Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

6
Src/Asp.Net/SqlServerTest/Config.cs

@ -8,8 +8,8 @@ namespace OrmTest
{
public class Config
{
public static string ConnectionString = "server=.;uid=sa;pwd=sasa;database=SqlSugar4XTest";
public static string ConnectionString2 = "server=.;uid=sa;pwd=sasa;database=SQLSUGAR4XTEST";
public static string ConnectionString3 = "server=.;uid=sa;pwd=sasa;database=sqlsugar4xtest";
public static string ConnectionString = "server=.;uid=sa;pwd=@jhl85661501;database=SqlSugar4XTest";
public static string ConnectionString2 = "server=.;uid=sa;pwd=@jhl85661501;database=SQLSUGAR4XTEST";
public static string ConnectionString3 = "server=.;uid=sa;pwd=@jhl85661501;database=sqlsugar4xtest";
}
}

3
Src/Asp.Net/SqlServerTest/Demos/2_Update.cs

@ -74,7 +74,8 @@ namespace OrmTest.Demo
var dt = new Dictionary<string, object>();
dt.Add("id", 1);
dt.Add("name", "1");
dt.Add("name", null);
dt.Add("createTime", DateTime.Now);
var t66 = db.Updateable(dt).AS("student").With(SqlWith.UpdLock).ExecuteCommand();
}
}

1
Src/Asp.Net/SqlServerTest/Demos/3_Insert.cs

@ -63,6 +63,7 @@ namespace OrmTest.Demo
var dt = new Dictionary<string, object>();
dt.Add("name", "1");
dt.Add("CreateTime", null);
var t66 = db.Insertable(dt).AS("student").ExecuteReturnIdentity();
}
}

2
Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs

@ -289,7 +289,7 @@ namespace SqlSugar
Value = column.Value,
DbColumnName = column.Key,
PropertyName = column.Key,
PropertyType = UtilMethods.GetUnderType(column.Value.GetType()),
PropertyType = column.Value == null? DBNull.Value.GetType(): UtilMethods.GetUnderType(column.Value.GetType()),
TableId = i
};
if (columnInfo.PropertyType.IsEnum())

2
Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

@ -280,7 +280,7 @@ namespace SqlSugar
Value = column.Value,
DbColumnName =column.Key,
PropertyName = column.Key,
PropertyType = UtilMethods.GetUnderType(column.Value.GetType()),
PropertyType = column.Value==null?DBNull.Value.GetType():UtilMethods.GetUnderType(column.Value.GetType()),
TableId = i
};
if (columnInfo.PropertyType.IsEnum())

Loading…
Cancel
Save