From 45ba7d260d9f13b189e6c9ba56b1396aac561334 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 20 Sep 2017 13:45:21 +0800 Subject: [PATCH] - --- .../SqlSugar/Abstract/DbFirstProvider/DbFirstProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/DbFirstProvider/DbFirstProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/DbFirstProvider/DbFirstProvider.cs index b1bcc287d..ebbbfec57 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DbFirstProvider/DbFirstProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DbFirstProvider/DbFirstProvider.cs @@ -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);