mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 02:14:53 +08:00
Update mysql db.Fastest
This commit is contained in:
@@ -76,7 +76,13 @@ namespace OrmTest
|
||||
Db.CodeFirst.InitTables<Testdbbool>();
|
||||
Db.DbMaintenance.TruncateTable("Testdbbool");
|
||||
Db.Insertable(new Testdbbool() { isok = true }).UseMySql().ExecuteBulkCopy();
|
||||
Db.Insertable(new Testdbbool() { isok = false }).UseMySql().ExecuteBulkCopy();
|
||||
Db.Fastest<Testdbbool>().BulkCopy(new List<Testdbbool>() { new Testdbbool() { isok = true }, new Testdbbool() { isok = false } });
|
||||
var list2= Db.Queryable<Testdbbool>().ToList();
|
||||
|
||||
if (!list2.Any(it => it.isok == false))
|
||||
{
|
||||
throw new Exception("blue copy");
|
||||
}
|
||||
|
||||
Db.CodeFirst.InitTables<MicroBlog>();
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace SqlSugar
|
||||
}
|
||||
dt.TableName = GetTableName();
|
||||
var columns = entityInfo.Columns;
|
||||
var isMySql = this.context.CurrentConnectionConfig.DbType == DbType.MySql;
|
||||
foreach (var item in datas)
|
||||
{
|
||||
var dr = dt.NewRow();
|
||||
@@ -71,6 +72,13 @@ namespace SqlSugar
|
||||
name = column.PropertyName;
|
||||
}
|
||||
var value = ValueConverter(column, PropertyCallAdapterProvider<T>.GetInstance(column.PropertyName).InvokeGet(item));
|
||||
if (isMySql&& column.UnderType==UtilConstants.BoolType)
|
||||
{
|
||||
if (value.ObjToBool() == false)
|
||||
{
|
||||
value = DBNull.Value;
|
||||
}
|
||||
}
|
||||
dr[name] = value;
|
||||
}
|
||||
dt.Rows.Add(dr);
|
||||
|
||||
Reference in New Issue
Block a user