😎兼容createTime可空模式
This commit is contained in:
parent
e8daf7aa5b
commit
3eb7f2e14f
@ -175,7 +175,7 @@ public static class SqlSugarSetup
|
|||||||
else if (entityInfo.PropertyName == nameof(EntityBase.CreateTime))
|
else if (entityInfo.PropertyName == nameof(EntityBase.CreateTime))
|
||||||
{
|
{
|
||||||
var createTime = entityInfo.EntityColumnInfo.PropertyInfo.GetValue(entityInfo.EntityValue)!;
|
var createTime = entityInfo.EntityColumnInfo.PropertyInfo.GetValue(entityInfo.EntityValue)!;
|
||||||
if (createTime.Equals(DateTime.MinValue))
|
if (createTime == null || createTime.Equals(DateTime.MinValue))
|
||||||
entityInfo.SetValue(DateTime.Now);
|
entityInfo.SetValue(DateTime.Now);
|
||||||
}
|
}
|
||||||
// 若当前用户非空(web线程时)
|
// 若当前用户非空(web线程时)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user