mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
- 续上优化 Enum 默认值容错
This commit is contained in:
parent
1f2d4abdc7
commit
741c558d91
@ -163,8 +163,8 @@ namespace FreeSql.Internal
|
|||||||
isEqualsEnumValue = true;
|
isEqualsEnumValue = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (isEqualsEnumValue == false)
|
if (isEqualsEnumValue == false && enumValues.Length > 0)
|
||||||
colattr.DbDefautValue = enumValues.Length > 0 ? enumValues.GetValue(0) : null;
|
colattr.DbDefautValue = enumValues.GetValue(0);
|
||||||
}
|
}
|
||||||
if (colattr.DbDefautValue != null && p.PropertyType != colattr.MapType) colattr.DbDefautValue = Utils.GetDataReaderValue(colattr.MapType, colattr.DbDefautValue);
|
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.DbDefautValue == null) colattr.DbDefautValue = tp?.defaultValue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user