Closed Yumitoya8569 closed 2 months ago
https://www.donet5.com/Home/Doc?typeId=2421 sqlsugar有自已的一套低代码
稍微研究了一下 $expand 好像無法被實作的樣子? $expand 允許嵌套查詢, 例如在$expand裡又一層$select或$expand
你是 select 子查询 as name 还是 join (select xx) 这2种都支持
qureyable.ToSql() 就能拿到SQL和参数这样就能嵌套了
$expand是導航, 只是允許再對導航作$select / $filter / $expand
例子:
?$select=f1,f2&$filter=f1 eq '1'&$expand=nav1($select=n1,n2;$expand=nav2)
你可以用代码来讲解,你这样我不清楚什么样子
到目前還沒有到代碼層面 而是探討OData v4規範實作的可行性
假設有這麼一組原始資料, 其中Orders是導航屬性
{
"value": [
{
"CustomerID": 1,
"Orders": [
{
"OrderID": 101
}
...
]
}
...
]
}
指定過濾條件
GET /odata/Customers?$filter=CustomerID eq 4
得到結果:
{
"value": [
{
"CustomerID": 4
}
]
}
以此為基礎再指定導航與導航的過濾條件
GET /odata/Customers?$filter=CustomerID eq 4&$expand=Orders($filter=OrderID eq 402)
得到結果:
{
"value": [
{
"CustomerID": 4,
"Orders": [
{
"OrderID": 402
}
]
}
]
}
大致上有頭緒了 謝謝
还有问题吗,没有就关闭了
先关闭还有疑问发新的ISSUE
目前OData庫大多需要IQueryable介面 且官方AspNetCoreOData這個項目問題實在太多, 幾乎不可用
因此想了解一下SqlSugar目前是否有足夠的彈性能夠實作OData? 主要是以下兩個核心類別的功能:
ODataQueryOption<T>
Delta<T>
能否給予建議?