mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
db.Fastest Support datetimeoffset
This commit is contained in:
parent
d54101ce68
commit
cf228b4155
@ -21,7 +21,12 @@ namespace OrmTest
|
||||
[SqlSugar.SugarColumn(IsNullable = true,IsJson =true,ColumnDataType ="varchar(500)")]
|
||||
public string [] json { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class TestFAST1121
|
||||
{
|
||||
|
||||
public DateTimeOffset A { get; set; }
|
||||
}
|
||||
public class DemoO_Fastest
|
||||
{
|
||||
public static void Init()
|
||||
@ -54,7 +59,10 @@ namespace OrmTest
|
||||
//db.Updateable(data).ExecuteCommand();
|
||||
db.Fastest<TestFAST111>().BulkUpdate(data);
|
||||
var x = db.Queryable<TestFAST111>().ToList();
|
||||
|
||||
db.CodeFirst.InitTables<TestFAST1121>();
|
||||
db.Fastest<TestFAST1121>().BulkCopy(new List<TestFAST1121>() {
|
||||
new TestFAST1121(){ A=DateTimeOffset.Now}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,13 +78,17 @@ namespace SqlSugar
|
||||
name = column.PropertyName;
|
||||
}
|
||||
var value = ValueConverter(column, PropertyCallAdapterProvider<T>.GetInstance(column.PropertyName).InvokeGet(item));
|
||||
if (isMySql&& column.UnderType==UtilConstants.BoolType)
|
||||
if (isMySql && column.UnderType == UtilConstants.BoolType)
|
||||
{
|
||||
if (value.ObjToBool() == false)
|
||||
{
|
||||
value = DBNull.Value;
|
||||
}
|
||||
}
|
||||
else if (column.UnderType == UtilConstants.DateTimeOffsetType&& value!=null)
|
||||
{
|
||||
value = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value);
|
||||
}
|
||||
dr[name] = value;
|
||||
}
|
||||
dt.Rows.Add(dr);
|
||||
|
Loading…
Reference in New Issue
Block a user