|
@ -21,6 +21,7 @@ namespace SqlSugar |
|
|
private bool IsDefaultValue { get; set; } |
|
|
private bool IsDefaultValue { get; set; } |
|
|
private Func<string, bool> WhereColumnsfunc; |
|
|
private Func<string, bool> WhereColumnsfunc; |
|
|
private Func<string, string> FormatFileNameFunc { get; set; } |
|
|
private Func<string, string> FormatFileNameFunc { get; set; } |
|
|
|
|
|
private bool IsStringNullable {get;set;} |
|
|
private ISqlBuilder SqlBuilder |
|
|
private ISqlBuilder SqlBuilder |
|
|
{ |
|
|
{ |
|
|
get |
|
|
get |
|
@ -56,6 +57,11 @@ namespace SqlSugar |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#region Setting Template
|
|
|
#region Setting Template
|
|
|
|
|
|
public IDbFirst StringNullable() |
|
|
|
|
|
{ |
|
|
|
|
|
IsStringNullable = true; |
|
|
|
|
|
return this; |
|
|
|
|
|
} |
|
|
public IDbFirst SettingClassDescriptionTemplate(Func<string, string> func) |
|
|
public IDbFirst SettingClassDescriptionTemplate(Func<string, string> func) |
|
|
{ |
|
|
{ |
|
|
this.ClassDescriptionTemplate = func(this.ClassDescriptionTemplate); |
|
|
this.ClassDescriptionTemplate = func(this.ClassDescriptionTemplate); |
|
@ -421,12 +427,16 @@ namespace SqlSugar |
|
|
} |
|
|
} |
|
|
if (result == "Int32") |
|
|
if (result == "Int32") |
|
|
{ |
|
|
{ |
|
|
result = "int"; |
|
|
result = item.IsNullable?"int?":"int"; |
|
|
} |
|
|
} |
|
|
if (result == "String") |
|
|
if (result == "String") |
|
|
{ |
|
|
{ |
|
|
result = "string"; |
|
|
result = "string"; |
|
|
} |
|
|
} |
|
|
|
|
|
if (result == "string" && item.IsNullable && IsStringNullable) |
|
|
|
|
|
{ |
|
|
|
|
|
result = result + "?"; |
|
|
|
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
private string GetPropertyTypeConvert(DbColumnInfo item) |
|
|
private string GetPropertyTypeConvert(DbColumnInfo item) |
|
|