mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
bulkCop UnitTestoffset11 nullable value=null bug
This commit is contained in:
parent
fe496f65ea
commit
fea4b6b690
@ -39,9 +39,19 @@ namespace OrmTest
|
||||
}
|
||||
|
||||
db.Fastest<Test2>().BulkUpdate(updateList);
|
||||
|
||||
db.CodeFirst.InitTables<UnitTestoffset11>();
|
||||
db.Fastest<UnitTestoffset11>().BulkCopy(new List<UnitTestoffset11>() {
|
||||
new UnitTestoffset11 { },
|
||||
new UnitTestoffset11 { DateTimeOffset= DateTimeOffset.Now}
|
||||
});
|
||||
var list = db.Queryable<UnitTestoffset11>().ToList();
|
||||
Console.WriteLine("用例跑完");
|
||||
}
|
||||
public class UnitTestoffset11
|
||||
{
|
||||
[SugarColumn(IsNullable =true)]
|
||||
public DateTimeOffset? DateTimeOffset { get; set; }
|
||||
}
|
||||
|
||||
[SugarTable("UnitFastest0011a")]
|
||||
public class Test2
|
||||
|
@ -85,7 +85,7 @@ namespace SqlSugar
|
||||
value = DBNull.Value;
|
||||
}
|
||||
}
|
||||
else if (column.UnderType == UtilConstants.DateTimeOffsetType&& value!=null)
|
||||
else if (column.UnderType == UtilConstants.DateTimeOffsetType&& value!=null && value != DBNull.Value)
|
||||
{
|
||||
value = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user