Insertable Updateable Dictionary BUG

This commit is contained in:
610262374@qq.com
2018-10-12 16:20:59 +08:00
parent b7091927b8
commit 291f2fe2d8
5 changed files with 8 additions and 6 deletions

View File

@@ -8,8 +8,8 @@ namespace OrmTest
{ {
public class Config public class Config
{ {
public static string ConnectionString = "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=sasa;database=SQLSUGAR4XTEST"; public static string ConnectionString2 = "server=.;uid=sa;pwd=@jhl85661501;database=SQLSUGAR4XTEST";
public static string ConnectionString3 = "server=.;uid=sa;pwd=sasa;database=sqlsugar4xtest"; public static string ConnectionString3 = "server=.;uid=sa;pwd=@jhl85661501;database=sqlsugar4xtest";
} }
} }

View File

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

View File

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

View File

@@ -289,7 +289,7 @@ namespace SqlSugar
Value = column.Value, Value = column.Value,
DbColumnName = column.Key, DbColumnName = column.Key,
PropertyName = 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 TableId = i
}; };
if (columnInfo.PropertyType.IsEnum()) if (columnInfo.PropertyType.IsEnum())

View File

@@ -280,7 +280,7 @@ namespace SqlSugar
Value = column.Value, Value = column.Value,
DbColumnName =column.Key, DbColumnName =column.Key,
PropertyName = 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 TableId = i
}; };
if (columnInfo.PropertyType.IsEnum()) if (columnInfo.PropertyType.IsEnum())