mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
DbFirst BUG
This commit is contained in:
parent
2119e813de
commit
37108aeefb
@ -173,9 +173,9 @@ namespace SqlSugar
|
||||
classText = classText.Replace(DbFirstTemplate.KeyPropertyName, PropertyText + (isLast ? "" : ("\r\n" + DbFirstTemplate.KeyPropertyName)));
|
||||
if (ConstructorText.IsValuable() && item.DefaultValue.IsValuable())
|
||||
{
|
||||
var isLastHasDefaultValue = columns.Skip(index + 1).Any(it=>!it.DefaultValue.IsValuable());
|
||||
var hasDefaultValue = columns.Skip(index + 1).Any(it=>it.DefaultValue.IsValuable());
|
||||
ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyPropertyName, propertyName);
|
||||
ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyDefaultValue, GetPropertyTypeConvert(item)) + (isLastHasDefaultValue ? "" : this.ConstructorTemplate);
|
||||
ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyDefaultValue, GetPropertyTypeConvert(item)) + (!hasDefaultValue ? "" : this.ConstructorTemplate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user