You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
35 lines
1.0 KiB
8 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Text;
|
||
|
using System.Threading.Tasks;
|
||
|
using SqlSugar;
|
||
|
using OrmTest.Models;
|
||
|
|
||
|
namespace OrmTest.PerformanceTesting
|
||
|
{
|
||
|
public class SqlSugarPerformance : PerformanceBase
|
||
|
{
|
||
8 years ago
|
public SqlSugarPerformance(int eachCount)
|
||
|
{
|
||
|
this.count = eachCount;
|
||
|
}
|
||
|
public void Select()
|
||
8 years ago
|
{
|
||
8 years ago
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||
8 years ago
|
{
|
||
|
ConnectionString = Config.ConnectionString,
|
||
|
DbType = DbType.SqlServer,
|
||
|
IsAutoCloseConnection = false
|
||
|
});
|
||
8 years ago
|
db.IgnoreColumns.Add("TestId", "Student");
|
||
8 years ago
|
db.Queryable<Student>().Select(it => new ViewModelStudent2 { Name = it.Name, Student = it }).ToList();
|
||
|
base.Execute("sqlsuagr", () =>
|
||
|
{
|
||
|
var test = db.Queryable<Student>().Select(it => new ViewModelStudent2 { Name = it.Name, Student = it }).ToList();
|
||
|
});
|
||
|
db.Close();
|
||
|
}
|
||
|
}
|
||
|
}
|