This commit is contained in:
sunkaixuan
2017-04-30 17:26:45 +08:00
parent 404cd9c3ba
commit c3b3d4e71f
12 changed files with 61 additions and 17 deletions

View File

@@ -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.

View File

@@ -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++)

View 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;
}
}
}

View 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;
}
}
}