mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-27 16:50:33 +08:00
Support Sqlserver tree
This commit is contained in:
15
Src/Asp.Net/SqlServerTest/Models/TestTree.cs
Normal file
15
Src/Asp.Net/SqlServerTest/Models/TestTree.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
||||
public class TestTree
|
||||
{
|
||||
[SqlSugar.SugarColumn(ColumnDataType = "hierarchyid")]
|
||||
public string TreeId { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -87,6 +87,7 @@
|
||||
<Compile Include="OldTest\Demos\K_MultiClient.cs" />
|
||||
<Compile Include="OldTest\Models\Brand.cs" />
|
||||
<Compile Include="OldTest\BugTest\Bug1.cs" />
|
||||
<Compile Include="Models\TestTree.cs" />
|
||||
<Compile Include="OldTest\Models\VendorAndBrand.cs" />
|
||||
<Compile Include="OldTest\Demos\F_VersionValidation.cs" />
|
||||
<Compile Include="OldTest\Demos\G_Mapper.cs" />
|
||||
|
||||
@@ -16,11 +16,15 @@ namespace OrmTest
|
||||
var totalPage = 0;
|
||||
var list=Db.Queryable<Order>().ToPageList(pageindex, pagesize, ref total, ref totalPage);
|
||||
|
||||
Db.CodeFirst.InitTables(typeof(CarType));
|
||||
Db.Updateable<CarType>()
|
||||
.SetColumns(it => new CarType { State =SqlSugar.SqlFunc.IIF(it.State==true,false,true) }).Where(it=>true)
|
||||
.ExecuteCommand();
|
||||
//Db.CodeFirst.InitTables(typeof(CarType));
|
||||
//Db.Updateable<CarType>()
|
||||
// .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')");
|
||||
//var list2 = Db.Queryable<TestTree>().ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user