mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 17:48:11 +08:00
Add demo
This commit is contained in:
@@ -46,8 +46,20 @@ namespace MongoDbTest
|
||||
db.Insertable(new School2() { StudentCount = 210 }).ExecuteCommand();
|
||||
var count2=db.Queryable<School2>().Max(s => s.StudentCount);
|
||||
if (count2!= 2222) Cases.ThrowUnitError();
|
||||
db.CodeFirst.InitTables<Student2>();
|
||||
db.DbMaintenance.TruncateTable<Student2>();
|
||||
db.Insertable(new Student2() { Bytes = new byte[] { 1, 2 } }).ExecuteCommand();
|
||||
var list4=db.Queryable<Student2>().ToList();
|
||||
db.Insertable(new List<Student2>() { new Student2() { Bytes = new byte[] { 2, 3 } }, new Student2() { Bytes = new byte[] { 3, 3 } } }).ExecuteCommand();
|
||||
var list5 = db.Queryable<Student2>().ToList();
|
||||
}
|
||||
}
|
||||
[SqlSugar.SugarTable("UnitStudent12313122")]
|
||||
public class Student2 : MongoDbBase
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public byte[] Bytes { get; set; }
|
||||
}
|
||||
[SqlSugar.SugarTable("UnitStudent123131")]
|
||||
public class Student : MongoDbBase
|
||||
{
|
||||
|
Reference in New Issue
Block a user