Update Demo

This commit is contained in:
sunkaixuan 2019-05-24 19:08:16 +08:00
parent 771265e250
commit 5584a620d5
2 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,8 @@ namespace OrmTest
{
[SqlSugar.SugarColumn(ColumnDataType = "hierarchyid")]
public string TreeId { get; set; }
[SqlSugar.SugarColumn(ColumnDataType = "Geography")]
public string GId { get; set; }
public string Name { get; set; }
}
}

View File

@ -18,12 +18,12 @@ namespace OrmTest
//Db.CodeFirst.InitTables(typeof(CarType));
//Db.Updateable<CarType>()
// .SetColumns(it => new CarType { State =SqlSugar.SqlFunc.IIF(it.State==true,false,true) }).Where(it=>true)
// .SetColumns(it => new CarType { State = SqlSugar.SqlFunc.IIF(it.State == true, false, true) }).Where(it => true)
// .ExecuteCommand();
//Db.CodeFirst.InitTables(typeof(TestTree));
//Db.DbMaintenance.TruncateTable<TestTree>();
//Db.Ado.ExecuteCommand("insert testtree values(hierarchyid::GetRoot(),'name')");
//Db.Ado.ExecuteCommand("insert testtree values(hierarchyid::GetRoot(),geography :: STGeomFromText ('POINT(55.9271035250276 -3.29431266523898)',4326),'name')");
//var list2 = Db.Queryable<TestTree>().ToList();
Db.CodeFirst.InitTables<GuidTable>();