2017-04-24 01:31:37 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Chloe;
|
|
|
|
|
using Chloe.SqlServer;
|
|
|
|
|
using OrmTest.Models;
|
|
|
|
|
|
|
|
|
|
namespace OrmTest.PerformanceTesting
|
|
|
|
|
{
|
|
|
|
|
public class ChloeORMPerformance: PerformanceBase
|
|
|
|
|
{
|
2017-04-30 19:45:14 +08:00
|
|
|
|
public ChloeORMPerformance(int eachCount)
|
|
|
|
|
{
|
|
|
|
|
this.count = eachCount;
|
|
|
|
|
}
|
2017-04-24 01:31:37 +08:00
|
|
|
|
public void Select()
|
|
|
|
|
{
|
|
|
|
|
MsSqlContext db = new MsSqlContext(Config.ConnectionString);
|
|
|
|
|
db.Query<Student>().Select(it => new ViewModelStudent2 { Name = it.Name, Student = it }).ToList();
|
|
|
|
|
base.Execute("chloe", () =>
|
|
|
|
|
{
|
|
|
|
|
var test = db.Query<Student>().Select(it => new ViewModelStudent2 { Name = it.Name, Student = it }).ToList();
|
|
|
|
|
});
|
|
|
|
|
db.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|