This commit is contained in:
sunkaixuan
2017-03-05 00:29:53 +08:00
parent 8240f7be60
commit 7a03e52621
6 changed files with 74 additions and 11 deletions

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using System.Linq.Expressions;
using OrmTest.Models;
namespace OrmTest.UnitTest
{
public class SelectQuery : ExpTestBase
{
private SelectQuery() { }
public SelectQuery(int eachCount)
{
this.Count = eachCount;
}
internal void Init()
{
base.Begin();
for (int i = 0; i < base.Count; i++)
{
Q2();
}
base.End("Method Test");
}
public void Q2()
{
using (var db = GetInstance())
{
var list = db.Queryable<Student>().Where(st => st.Id > 0).ToList();
}
}
public SqlSugarClient GetInstance()
{
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });
return db;
}
}
}