2019-05-20 16:15:01 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace OrmTest
|
|
|
|
|
{
|
|
|
|
|
public partial class NewUnitTest
|
|
|
|
|
{
|
|
|
|
|
public static void Queryable() {
|
|
|
|
|
|
|
|
|
|
var pageindex = 1;
|
|
|
|
|
var pagesize = 10;
|
|
|
|
|
var total = 0;
|
|
|
|
|
var totalPage = 0;
|
|
|
|
|
var list=Db.Queryable<Order>().ToPageList(pageindex, pagesize, ref total, ref totalPage);
|
|
|
|
|
|
2019-05-23 19:25:51 +08:00
|
|
|
|
//Db.CodeFirst.InitTables(typeof(CarType));
|
|
|
|
|
//Db.Updateable<CarType>()
|
2019-05-24 19:08:16 +08:00
|
|
|
|
// .SetColumns(it => new CarType { State = SqlSugar.SqlFunc.IIF(it.State == true, false, true) }).Where(it => true)
|
2019-05-23 19:25:51 +08:00
|
|
|
|
// .ExecuteCommand();
|
2019-05-20 20:10:21 +08:00
|
|
|
|
|
2019-05-23 19:25:51 +08:00
|
|
|
|
//Db.CodeFirst.InitTables(typeof(TestTree));
|
|
|
|
|
//Db.DbMaintenance.TruncateTable<TestTree>();
|
2019-05-24 19:08:16 +08:00
|
|
|
|
//Db.Ado.ExecuteCommand("insert testtree values(hierarchyid::GetRoot(),geography :: STGeomFromText ('POINT(55.9271035250276 -3.29431266523898)',4326),'name')");
|
2019-05-23 19:25:51 +08:00
|
|
|
|
//var list2 = Db.Queryable<TestTree>().ToList();
|
2019-05-23 21:30:45 +08:00
|
|
|
|
|
|
|
|
|
Db.CodeFirst.InitTables<GuidTable>();
|
|
|
|
|
Db.Queryable<GuidTable>().Where(it => it.Id.HasValue).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class GuidTable
|
|
|
|
|
{
|
|
|
|
|
public Guid? Id { get; set; }
|
2019-05-20 16:15:01 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|