mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Add unit test
This commit is contained in:
parent
5396b085c8
commit
10950e15db
@ -102,6 +102,7 @@
|
||||
<Compile Include="UnitTest\Models\001\ShoujiSubnum.cs" />
|
||||
<Compile Include="UnitTest\Models\001\ShoujiViewDto.cs" />
|
||||
<Compile Include="UnitTest\Models\Unit23131.cs" />
|
||||
<Compile Include="UnitTest\UEnum2.cs" />
|
||||
<Compile Include="UnitTest\UinitCustomConvert.cs" />
|
||||
<Compile Include="UnitTest\UInsert3.cs" />
|
||||
<Compile Include="UnitTest\UJson2.cs" />
|
||||
|
@ -31,6 +31,7 @@ namespace OrmTest
|
||||
}
|
||||
public static void Init()
|
||||
{
|
||||
UEnum2.Init();
|
||||
UnitManyToMany4.Init();
|
||||
UnitManyToMany3.Init();
|
||||
UnitUpdateOneToMany.Init();
|
||||
|
32
Src/Asp.Net/SqlServerTest/UnitTest/UEnum2.cs
Normal file
32
Src/Asp.Net/SqlServerTest/UnitTest/UEnum2.cs
Normal file
@ -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<Unitadfas3>();
|
||||
db.Insertable(new Unitadfas3() { DbType = SqlSugar.DbType.GBase }).ExecuteCommand();
|
||||
var first = db.Queryable<Unitadfas3>().First();
|
||||
db.Updateable(first).ExecuteCommand();
|
||||
var first2 = db.Queryable<Unitadfas3>().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; }
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user