mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-02 03:13:58 +08:00
-
This commit is contained in:
@@ -72,6 +72,8 @@
|
||||
<Compile Include="Models\Student.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UnitTest\RenameMapping\MapColumn.cs" />
|
||||
<Compile Include="UnitTest\RenameMapping\MapTable.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
@@ -82,9 +84,7 @@
|
||||
<Name>SqlSugar</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="UnitTest\RenameMapping\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -19,13 +19,13 @@ namespace OrmTest
|
||||
{
|
||||
//Unit Test
|
||||
int eachCount = 1;
|
||||
new Field(eachCount).Init();
|
||||
new Where(eachCount).Init();
|
||||
new Method(eachCount).Init();
|
||||
new JoinQuery(eachCount).Init();
|
||||
new SingleQuery(eachCount).Init();
|
||||
new SelectQuery(eachCount).Init();
|
||||
|
||||
//new Field(eachCount).Init();
|
||||
//new Where(eachCount).Init();
|
||||
//new Method(eachCount).Init();
|
||||
//new JoinQuery(eachCount).Init();
|
||||
//new SingleQuery(eachCount).Init();
|
||||
//new SelectQuery(eachCount).Init();
|
||||
new MapTable().Init();
|
||||
|
||||
//Performance Test
|
||||
for (int i = 0; i < 100; i++)
|
||||
|
||||
18
OrmTest/UnitTest/RenameMapping/MapColumn.cs
Normal file
18
OrmTest/UnitTest/RenameMapping/MapColumn.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest.UnitTest
|
||||
{
|
||||
public class MapColumn : ExpTestBase
|
||||
{
|
||||
public SqlSugarClient GetInstance()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });
|
||||
return db;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
OrmTest/UnitTest/RenameMapping/MapTable.cs
Normal file
26
OrmTest/UnitTest/RenameMapping/MapTable.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using OrmTest.Models;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest.UnitTest
|
||||
{
|
||||
public class MapTable : ExpTestBase
|
||||
{
|
||||
public void Init()
|
||||
{
|
||||
using (var db = GetInstance())
|
||||
{
|
||||
var x= db.Queryable<Student>().ToList();
|
||||
}
|
||||
}
|
||||
public SqlSugarClient GetInstance()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
|
||||
return db;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user