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
9d873846bc
commit
b17d01b7cc
@ -202,6 +202,7 @@
|
||||
<Compile Include="UnitTest\UOneManyMany2.cs" />
|
||||
<Compile Include="UnitTest\UOneManyMany.cs" />
|
||||
<Compile Include="UnitTest\UOneManyMany7.cs" />
|
||||
<Compile Include="UnitTest\UQueryableByObject.cs" />
|
||||
<Compile Include="UnitTest\USelectSinleDTO.cs" />
|
||||
<Compile Include="UnitTest\USelectTest.cs" />
|
||||
<Compile Include="UnitTest\USplit.cs" />
|
||||
|
@ -31,6 +31,7 @@ namespace OrmTest
|
||||
}
|
||||
public static void Init()
|
||||
{
|
||||
UQueryableByObject.Init();
|
||||
Unit23131.Init();
|
||||
SplitTest2();
|
||||
UOneManyMany7.init();
|
||||
|
25
Src/Asp.Net/SqlServerTest/UnitTest/UQueryableByObject.cs
Normal file
25
Src/Asp.Net/SqlServerTest/UnitTest/UQueryableByObject.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
||||
internal class UQueryableByObject
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
var db = NewUnitTest.Db;
|
||||
var type = typeof(Order);
|
||||
var data=db.QueryableByObject(type)
|
||||
.Where("id=1").ToList();
|
||||
var data2=db.QueryableByObject(type)
|
||||
.Where("id=@id",new {id=1 }).ToList();
|
||||
var data3 = db.QueryableByObject(type)
|
||||
.OrderBy("id").Where("id=@id", new { id = 1 }).ToList();
|
||||
var data4 = db.QueryableByObject(type)
|
||||
.GroupBy("id").Having("count(name)>0").Select("Id").ToList();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user