mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 14:04:44 +08:00
MySql bluk copy bool bug
This commit is contained in:
parent
d3733ffddb
commit
391015050d
@ -72,6 +72,12 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Db.CodeFirst.InitTables<Testdbbool>();
|
||||||
|
Db.DbMaintenance.TruncateTable("Testdbbool");
|
||||||
|
Db.Insertable(new Testdbbool() { isok=true }).UseMySql().ExecuteBlueCopy();
|
||||||
|
Db.Insertable(new Testdbbool() { isok = false }).UseMySql().ExecuteBlueCopy();
|
||||||
|
var x=Db.Queryable<Testdbbool>().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class testdb
|
public class testdb
|
||||||
@ -81,5 +87,12 @@ namespace OrmTest
|
|||||||
public string id { get; set; }
|
public string id { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Testdbbool
|
||||||
|
{
|
||||||
|
[SqlSugar.SugarColumn(IsPrimaryKey = true,IsIdentity =true)]
|
||||||
|
public int id { get; set; }
|
||||||
|
public bool isok { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
name = entity.Columns.First(it => it.PropertyName == name).DbColumnName;
|
name = entity.Columns.First(it => it.PropertyName == name).DbColumnName;
|
||||||
}
|
}
|
||||||
row[name] = p.GetValue(item, null);
|
row[name] = GetValue(p, item);
|
||||||
});
|
});
|
||||||
dt.Rows.Add(row);
|
dt.Rows.Add(row);
|
||||||
}
|
}
|
||||||
@ -170,6 +170,21 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static object GetValue(PropertyInfo p, T item)
|
||||||
|
{
|
||||||
|
var result= p.GetValue(item, null);
|
||||||
|
if (result != null && UtilMethods.GetUnderType(p.PropertyType) == UtilConstants.BoolType)
|
||||||
|
{
|
||||||
|
if (result.ObjToBool() == false)
|
||||||
|
{
|
||||||
|
result = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user