Browse Source

BUG: Storageable enum primary key

pull/26/head
sunkaixuan 2 years ago
parent
commit
6dd5ed29cf
  1. 5
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

5
Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

@ -539,6 +539,11 @@ namespace SqlSugar
FieldValue = value.ObjToStringNew(),
CSharpTypeName = column.PropertyInfo.PropertyType.Name
});
if(value is Enum&&this.Context.CurrentConnectionConfig?.MoreSettings?.TableEnumIsString!=true)
{
data.Value.FieldValue = Convert.ToInt64(value).ObjToString();
data.Value.CSharpTypeName = "int";
}
//if (this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
//{
// data.Value.FieldValueConvertFunc = it =>

Loading…
Cancel
Save