mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Update mongodb
This commit is contained in:
@@ -29,11 +29,15 @@ namespace MongoDbTest
|
|||||||
var tableCount = db.Queryable<School>().ToList().Count;
|
var tableCount = db.Queryable<School>().ToList().Count;
|
||||||
if(tableCount!=3) Cases.ThrowUnitError();
|
if(tableCount!=3) Cases.ThrowUnitError();
|
||||||
|
|
||||||
db.Insertable(new School() { Name = "zz大学" }).ExecuteCommand();
|
db.Insertable(new School() { Name = "ss大学" }).ExecuteCommand();
|
||||||
db.Insertable(new School() { Name = "yy大学" }).ExecuteCommand();
|
db.Insertable(new School() { Name = "yy大学" }).ExecuteCommand();
|
||||||
var count = 0;
|
var count = 0;
|
||||||
var list = db.Queryable<School>().OrderBy(it=>it.Name).ToPageList(1,2,ref count);
|
var list = db.Queryable<School>().OrderBy(it=>it.Name).ToPageList(1,2,ref count);
|
||||||
if(count != 5||list.Count!=2) Cases.ThrowUnitError();
|
if(count != 5||list.Count!=2) Cases.ThrowUnitError();
|
||||||
|
|
||||||
|
var list3 = db.Queryable<School>().Where(it=>it.Name== "zz大学"||it.Name== "ss大学").ToPageList(1, 2, ref count);
|
||||||
|
if(count!=2||list3.Count!=2) Cases.ThrowUnitError();
|
||||||
|
if (list3.First().Name!= "zz大学"|| list3.Last().Name != "ss大学") Cases.ThrowUnitError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[SqlSugar.SugarTable("UnitStudent123131")]
|
[SqlSugar.SugarTable("UnitStudent123131")]
|
||||||
|
@@ -10,7 +10,7 @@ namespace SqlSugar.MongoDb
|
|||||||
{
|
{
|
||||||
public override int Count()
|
public override int Count()
|
||||||
{
|
{
|
||||||
return base.Count();
|
return GetCount(); ;
|
||||||
}
|
}
|
||||||
public override ISugarQueryable<T> With(string withString)
|
public override ISugarQueryable<T> With(string withString)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user