|
@ -157,7 +157,7 @@ namespace OrmTest.Demo |
|
|
var getAll = db.Queryable<Student>().ToList(); |
|
|
var getAll = db.Queryable<Student>().ToList(); |
|
|
var getAllOrder = db.Queryable<Student>().OrderBy(it => it.Id).OrderBy(it => it.Name, OrderByType.Desc).ToList(); |
|
|
var getAllOrder = db.Queryable<Student>().OrderBy(it => it.Id).OrderBy(it => it.Name, OrderByType.Desc).ToList(); |
|
|
var getId = db.Queryable<Student>().Select(it => it.Id).ToList(); |
|
|
var getId = db.Queryable<Student>().Select(it => it.Id).ToList(); |
|
|
// var getNew = db.Queryable<Student>().Where(it => it.Id == 1).Select(it => new { id = SqlFunc.IIF(it.Id == 0, 1, it.Id), it.Name, it.SchoolId }).ToList();
|
|
|
var getNew = db.Queryable<Student>().Where(it => it.Id == 1).Select(it => new { id = SqlFunc.IIF(it.Id == 0, 1, it.Id), it.Name, it.SchoolId }).ToList(); |
|
|
var getAllNoLock = db.Queryable<Student>().With(SqlWith.NoLock).ToList(); |
|
|
var getAllNoLock = db.Queryable<Student>().With(SqlWith.NoLock).ToList(); |
|
|
var getByPrimaryKey = db.Queryable<Student>().InSingle(2); |
|
|
var getByPrimaryKey = db.Queryable<Student>().InSingle(2); |
|
|
var getSingleOrDefault = db.Queryable<Student>().Single(); |
|
|
var getSingleOrDefault = db.Queryable<Student>().Single(); |
|
|