mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-21 02:58:05 +08:00
Updater mongodb
This commit is contained in:
@@ -119,14 +119,49 @@ namespace MongoDbTest
|
|||||||
var list6 = db.Queryable<Student>()
|
var list6 = db.Queryable<Student>()
|
||||||
.LeftJoin<School>((x, y) => x.SchoolId == y.Id)
|
.LeftJoin<School>((x, y) => x.SchoolId == y.Id)
|
||||||
.OrderBy((x, y) => x.Name)
|
.OrderBy((x, y) => x.Name)
|
||||||
.Select((x, y) => new
|
.Select((x, y) => new
|
||||||
{
|
{
|
||||||
StudentName = x.Name,
|
StudentName = x.Name,
|
||||||
SchoolName = y.Name
|
SchoolName = y.Name
|
||||||
}).ToList();
|
}).ToList();
|
||||||
if (list6.Count != 4) Cases.ThrowUnitError();
|
if (list6.Count != 4) Cases.ThrowUnitError();
|
||||||
if (list6.Last().StudentName != "jack") Cases.ThrowUnitError();
|
if (list6.Last().StudentName != "jack") Cases.ThrowUnitError();
|
||||||
if (list6.First().StudentName != "A") Cases.ThrowUnitError();
|
if (list6.First().StudentName != "A") Cases.ThrowUnitError();
|
||||||
|
|
||||||
|
|
||||||
|
var list7 = db.Queryable<Student>()
|
||||||
|
.LeftJoin<School>((x, y) => x.SchoolId == y.Id)
|
||||||
|
.OrderBy((x, y) => x.Name)
|
||||||
|
.Select((x, y) => new
|
||||||
|
{
|
||||||
|
StudentName = x.Name,
|
||||||
|
SchoolName = y.Name
|
||||||
|
}).ToPageList(1,2);
|
||||||
|
if (list7.Count != 2) Cases.ThrowUnitError();
|
||||||
|
if (list7.First().StudentName != "A") Cases.ThrowUnitError();
|
||||||
|
|
||||||
|
var count = 0;
|
||||||
|
var list8 = db.Queryable<Student>()
|
||||||
|
.LeftJoin<School>((x, y) => x.SchoolId == y.Id)
|
||||||
|
.OrderBy((x, y) => x.Name)
|
||||||
|
.Select((x, y) => new
|
||||||
|
{
|
||||||
|
StudentName = x.Name,
|
||||||
|
SchoolName = y.Name
|
||||||
|
}).ToPageList(1, 2,ref count);
|
||||||
|
if(count!=4||list8.Count!=2||list8.First().StudentName!="A") Cases.ThrowUnitError();
|
||||||
|
|
||||||
|
var count2 = 0;
|
||||||
|
var list9 = db.Queryable<Student>()
|
||||||
|
.LeftJoin<School>((x, y) => x.SchoolId == y.Id)
|
||||||
|
.Where(x=>x.Name!="jack")
|
||||||
|
.OrderBy((x, y) => x.Name)
|
||||||
|
.Select((x, y) => new
|
||||||
|
{
|
||||||
|
StudentName = x.Name,
|
||||||
|
SchoolName = y.Name
|
||||||
|
}).ToPageList(1, 2, ref count2);
|
||||||
|
if (count2 != 3 || list9.Count != 2 || list9.First().StudentName != "A") Cases.ThrowUnitError();
|
||||||
}
|
}
|
||||||
[SqlSugar.SugarTable("UnitStudent123131")]
|
[SqlSugar.SugarTable("UnitStudent123131")]
|
||||||
public class Student : MongoDbBase
|
public class Student : MongoDbBase
|
||||||
|
@@ -264,12 +264,12 @@ namespace SqlSugar.MongoDb
|
|||||||
|
|
||||||
ProcessJoinInfoConditions(operations);
|
ProcessJoinInfoConditions(operations);
|
||||||
|
|
||||||
ProcessWhereConditions(operations);
|
ProcessWhereConditions(operations);
|
||||||
|
|
||||||
|
ProcessOrderByConditions(operations);
|
||||||
|
|
||||||
ProcessPagination(operations);
|
ProcessPagination(operations);
|
||||||
|
|
||||||
ProcessOrderByConditions(operations);
|
|
||||||
|
|
||||||
ProcessSelectConditions(operations);
|
ProcessSelectConditions(operations);
|
||||||
|
|
||||||
ProcessGroupByConditions(operations);
|
ProcessGroupByConditions(operations);
|
||||||
|
Reference in New Issue
Block a user