This commit is contained in:
sunkaixuan
2017-03-05 16:18:49 +08:00
parent 7a03e52621
commit 1aa10dc302
21 changed files with 167 additions and 93 deletions

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest.Models
{
public class ViewModelStudent:Student
{
}
}

View File

@@ -44,6 +44,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="Models\ViewModelStudent.cs" />
<Compile Include="UnitTest\ExpressionTest\ExpTestBase.cs" />
<Compile Include="UnitTest\ExpressionTest\Field.cs" />
<Compile Include="UnitTest\Query\JoinQuery.cs" />

View File

@@ -16,13 +16,13 @@ namespace OrmTest
static void Main(string[] args)
{
//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 SingleQuery(eachCount).Init();
int eachCount = 1000;
//new Field(eachCount).Init();
//new Where(eachCount).Init();
//new Method(eachCount).Init();
//new JoinQuery(eachCount).Init();
//new SingleQuery(eachCount).Init();
new SelectQuery(eachCount).Init();
}
}
}

View File

@@ -29,7 +29,12 @@ namespace OrmTest.UnitTest
{
using (var db = GetInstance())
{
var list = db.Queryable<Student>().Where(st => st.Id > 0).ToList();
var list = db.Queryable<Student>()
.Where(st => st.Id > 0)
.Select(it => new ViewModelStudent { Name = it.Name }).ToList();
var list2 = db.Queryable<Student>()
.Where(st => st.Id > 0)
.Select("*").ToList();
}
}