mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
- 优化 内部实体管理的默认值,防止导航属性使用抽象类/接口时出现错误;
This commit is contained in:
parent
8a11e9c794
commit
49a1eecb45
@ -155,8 +155,7 @@ namespace FreeSql.Internal
|
||||
trytb.ColumnsByCsIgnore.Add(p.Name, col);
|
||||
continue;
|
||||
}
|
||||
if (entityDefault == null) entityDefault = Activator.CreateInstance(entity);
|
||||
colattr.DbDefautValue = trytb.Properties[p.Name].GetValue(entityDefault);
|
||||
if (entityDefault != null) colattr.DbDefautValue = trytb.Properties[p.Name].GetValue(entityDefault);
|
||||
if (colattr.DbDefautValue != null && p.PropertyType != colattr.MapType) colattr.DbDefautValue = Utils.GetDataReaderValue(colattr.MapType, colattr.DbDefautValue);
|
||||
if (colattr.DbDefautValue == null) colattr.DbDefautValue = tp?.defaultValue;
|
||||
if (colattr.IsNullable == false && colattr.DbDefautValue == null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user