This commit is contained in:
sunkaixuan
2017-09-20 13:45:21 +08:00
parent 40d68186c7
commit 45ba7d260d

View File

@@ -177,7 +177,7 @@ namespace SqlSugar
PropertyDescriptionText = GetPropertyDescriptionText(item, PropertyDescriptionText);
PropertyText = PropertyDescriptionText + PropertyText;
classText = classText.Replace(DbFirstTemplate.KeyPropertyName, PropertyText + (isLast ? "" : ("\r\n" + DbFirstTemplate.KeyPropertyName)));
if (ConstructorText.IsValuable() && item.DefaultValue.IsValuable())
if (ConstructorText.IsValuable() && item.DefaultValue!=null)
{
var hasDefaultValue = columns.Skip(index + 1).Any(it=>it.DefaultValue.IsValuable());
ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyPropertyName, propertyName);