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
d20b520d7c
commit
09df941f71
@ -86,6 +86,7 @@
|
||||
<Compile Include="Models\Unit\Custom1\PurchaseDetailModel.cs" />
|
||||
<Compile Include="Models\ViewOrder.cs" />
|
||||
<Compile Include="Demo\DemoJ_Report.cs" />
|
||||
<Compile Include="UnitTest\UDelete.cs" />
|
||||
<Compile Include="UnitTest\UBulkCopy.cs" />
|
||||
<Compile Include="UnitTest\UCustom011.cs" />
|
||||
<Compile Include="UnitTest\UCustom012.cs" />
|
||||
|
@ -31,6 +31,7 @@ namespace OrmTest
|
||||
}
|
||||
public static void Init()
|
||||
{
|
||||
UDelete.Init();
|
||||
UCustom012.Init();
|
||||
UCustom014.Init();
|
||||
UCustom015.Init();
|
||||
|
49
Src/Asp.Net/MySqlTest/UnitTest/UDelete.cs
Normal file
49
Src/Asp.Net/MySqlTest/UnitTest/UDelete.cs
Normal file
@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SqlSugar;
|
||||
namespace OrmTest
|
||||
{
|
||||
public class UDelete
|
||||
{
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
var db = NewUnitTest.Db;
|
||||
db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
DisableNvarchar = true
|
||||
};
|
||||
db.CodeFirst.InitTables<PlayerWeaponSkinEntity>();
|
||||
db.Deleteable(new List<PlayerWeaponSkinEntity>() {
|
||||
new PlayerWeaponSkinEntity(){
|
||||
PlayerId=1,
|
||||
Seed=1
|
||||
},
|
||||
new PlayerWeaponSkinEntity(){
|
||||
PlayerId=1,
|
||||
Seed=1
|
||||
}
|
||||
}).ExecuteCommand();
|
||||
}
|
||||
|
||||
[SugarTable("kcf_player_weaponskin")]
|
||||
public class PlayerWeaponSkinEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家PlayerID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "pid", IsPrimaryKey = true)]
|
||||
public uint PlayerId { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "weapon", IsPrimaryKey = true)]
|
||||
public string WeaponClass { get; set; } = "__weapon_class__";
|
||||
|
||||
public ushort Skin { get; set; }
|
||||
public ushort Seed { get; set; }
|
||||
public decimal Wear { get; set; } // don't use float
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user