mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 17:48:11 +08:00
Update mysql bulkcopy
This commit is contained in:
@@ -170,8 +170,24 @@ namespace OrmTest
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
db.CodeFirst.InitTables<UnitBulkdatedate2313111>();
|
||||
db.DbMaintenance.TruncateTable<UnitBulkdatedate2313111>();
|
||||
var bda =new List<UnitBulkdatedate2313111>{ new UnitBulkdatedate2313111()
|
||||
{
|
||||
Id = Guid.NewGuid()
|
||||
} };
|
||||
db.Fastest<UnitBulkdatedate2313111>().BulkCopy(bda);
|
||||
var q = db.Queryable<UnitBulkdatedate2313111>().ToList();
|
||||
|
||||
}
|
||||
public class UnitBulkdatedate2313111
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
public Guid Id { get; set; }
|
||||
[SqlSugar.SugarColumn(IsNullable = true)]
|
||||
public DateTime? table { get; set; }
|
||||
}
|
||||
|
||||
public class UnitBulk2313111
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
|
@@ -176,6 +176,10 @@ namespace SqlSugar
|
||||
{
|
||||
sb.Append(row[colum].ObjToDate().ToString("yyyy-MM-dd HH:mm:ss.fff"));
|
||||
}
|
||||
else if (colum.DataType == UtilConstants.DateType && row[colum] != null && row[colum] == DBNull.Value)
|
||||
{
|
||||
sb.Append("NULL");
|
||||
}
|
||||
else sb.Append(row[colum].ToString());
|
||||
}
|
||||
sb.AppendLine();
|
||||
|
Reference in New Issue
Block a user