Update db.DbFirst

This commit is contained in:
sunkaixuan
2023-10-08 20:02:25 +08:00
parent 5284ba1fca
commit 84d03e81d7

View File

@@ -299,6 +299,10 @@ namespace SqlSugar
{ {
item.DefaultValue = "DateTime.Now"; item.DefaultValue = "DateTime.Now";
} }
else if (item.DefaultValue == "b'1'")
{
item.DefaultValue = "1";
}
ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyPropertyName, propertyName); ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyPropertyName, propertyName);
ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyDefaultValue, GetPropertyTypeConvert(item)) + (!hasDefaultValue ? "" : this.ConstructorTemplate); ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyDefaultValue, GetPropertyTypeConvert(item)) + (!hasDefaultValue ? "" : this.ConstructorTemplate);
} }