mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add unit test
This commit is contained in:
parent
7f66894ca3
commit
89ef7aeb88
@ -96,6 +96,7 @@
|
||||
<Compile Include="Models\OrderItem.cs" />
|
||||
<Compile Include="Demo\Demo0_SqlSugarClient.cs" />
|
||||
<Compile Include="Models\ViewOrder.cs" />
|
||||
<Compile Include="UnitTest\UCustom024.cs" />
|
||||
<Compile Include="UnitTest\UCustomNavigate01.cs" />
|
||||
<Compile Include="UnitTest\Models\DSPersonScheduleModel.cs" />
|
||||
<Compile Include="UnitTest\Models\PersonScheduleParam.cs" />
|
||||
|
35
Src/Asp.Net/SqlServerTest/UnitTest/UCustom024.cs
Normal file
35
Src/Asp.Net/SqlServerTest/UnitTest/UCustom024.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
||||
public class UCustom024
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
var db = NewUnitTest.Db;
|
||||
var data=db.EntityMaintenance.GetEntityInfoNoCache(typeof(UnitNewP));
|
||||
db.CodeFirst.InitTables<UnitNewP>();
|
||||
db.Insertable(new UnitNewP() { Id = Guid.NewGuid() }).ExecuteCommand();
|
||||
var list=db.Queryable<UnitNewP>().Take(2).ToList();
|
||||
db.Updateable(list).ExecuteCommand();
|
||||
db.Deleteable(list).ExecuteCommand();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class UnitNewP: UnitBaseP
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey =true)]
|
||||
public new Guid Id { get; set; }
|
||||
[SqlSugar.SugarColumn(IsNullable =true)]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
public class UnitBaseP
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user