mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
Add demo
This commit is contained in:
parent
e81c8e1fca
commit
a7936acbe1
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq.Dynamic.Core;
|
using System.Linq.Dynamic.Core;
|
||||||
using System.Linq.Dynamic.Core.CustomTypeProviders;
|
using System.Linq.Dynamic.Core.CustomTypeProviders;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using static OrmTest.UnitOneToManyFiltersadfa;
|
||||||
|
|
||||||
namespace OrmTest
|
namespace OrmTest
|
||||||
{
|
{
|
||||||
@ -128,8 +129,24 @@ namespace OrmTest
|
|||||||
.Where("it", $"SqlFunc.Exists(it.Address.Id)")
|
.Where("it", $"SqlFunc.Exists(it.Address.Id)")
|
||||||
.OrderBy((it, y) => it.Id)
|
.OrderBy((it, y) => it.Id)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
//Select实现返回导航属性
|
||||||
|
var list66 = db.Queryable<UnitPerson011>()
|
||||||
|
.Includes(it => it.Address)
|
||||||
|
.Select(it => new
|
||||||
|
{
|
||||||
|
addid=it.Address.Id,
|
||||||
|
Address =it.Address
|
||||||
|
}).ToList();
|
||||||
|
var list666 = db.Queryable<UnitPerson011>()
|
||||||
|
.Includes(it=>it.Address)
|
||||||
|
.Select("it",
|
||||||
|
new List<string>()
|
||||||
|
{
|
||||||
|
" it.Address.Id as addid" ,
|
||||||
|
"it.Address as Address"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.ToList();
|
||||||
var xxx = DynamicCoreHelper.GetMember(typeof(UnitPerson011), typeof(int), "it", $"it.Address.Id ");
|
var xxx = DynamicCoreHelper.GetMember(typeof(UnitPerson011), typeof(int), "it", $"it.Address.Id ");
|
||||||
var list7= db.Queryable<UnitPerson011>().Select<int>("it", $"it.Address.Id ",typeof(UnitPerson011), typeof(int)).ToList();
|
var list7= db.Queryable<UnitPerson011>().Select<int>("it", $"it.Address.Id ",typeof(UnitPerson011), typeof(int)).ToList();
|
||||||
var list8 = db.Queryable<Order>().Select("it", $"new(it.Id as Id, it.Name)", typeof(Order)).ToList();
|
var list8 = db.Queryable<Order>().Select("it", $"new(it.Id as Id, it.Name)", typeof(Order)).ToList();
|
||||||
|
Loading…
Reference in New Issue
Block a user