- 完善 [Column(ServerTime = Utc)] 特性,对 Update 时也能生效;

This commit is contained in:
28810
2020-01-06 19:36:30 +08:00
parent bbba06a343
commit fbbd74f54c
11 changed files with 82 additions and 37 deletions

View File

@ -188,8 +188,9 @@ namespace FreeSql.Internal
//}
if (colattr.ServerTime != DateTimeKind.Unspecified && new[] { typeof(DateTime), typeof(DateTimeOffset) }.Contains(colattr.MapType.NullableTypeOrThis()))
{
col.DbDefaultValue = colattr.ServerTime == DateTimeKind.Local ? common.Now : common.NowUtc;
col.DbDefaultValue = "'1970-1-1'";
col.DbInsertValue = colattr.ServerTime == DateTimeKind.Local ? common.Now : common.NowUtc;
col.DbUpdateValue = colattr.ServerTime == DateTimeKind.Local ? common.Now : common.NowUtc;
}
if (string.IsNullOrEmpty(colattr.InsertValueSql) == false)
{