diff --git a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj index 35a5a550b..48798dba5 100644 --- a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj +++ b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj @@ -102,6 +102,7 @@ + diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs index cf278cc4c..8828e868f 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs @@ -31,6 +31,7 @@ namespace OrmTest } public static void Init() { + UEnum2.Init(); UnitManyToMany4.Init(); UnitManyToMany3.Init(); UnitUpdateOneToMany.Init(); diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UEnum2.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UEnum2.cs new file mode 100644 index 000000000..41362e9c6 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UEnum2.cs @@ -0,0 +1,32 @@ +using SqlSugar; +using SqlSugar.DbConvert; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + internal class UEnum2 + { + public static void Init() + { + var db = NewUnitTest.Db; + db.CodeFirst.InitTables(); + db.Insertable(new Unitadfas3() { DbType = SqlSugar.DbType.GBase }).ExecuteCommand(); + var first = db.Queryable().First(); + db.Updateable(first).ExecuteCommand(); + var first2 = db.Queryable().First(); + + } + public class Unitadfas3 + { + [SugarColumn(IsPrimaryKey =true,IsIdentity =true)] + public int id { get; set; } + [SugarColumn(ColumnDataType ="varchar(20)",SqlParameterDbType =typeof(EnumToStringConvert))] + public SqlSugar.DbType DbType { get; set; } + } + } +}