mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-24 01:00:59 +08:00
update
4
动态操作.md
4
动态操作.md
@@ -64,11 +64,11 @@ var orderByMapping = new Dictionary<string, string>
|
||||
["order2"] = "len(a.name) desc"
|
||||
};
|
||||
|
||||
//假设前端 POST 内容是 where1、where2
|
||||
//假设前端 POST 内容是 postWhere=where1&postWhereValue=100&postOrder=order1
|
||||
fsql.Select<Region>()
|
||||
.WhereIf(
|
||||
whereMapping.TryGetValue(postWhere, out var whereSql),
|
||||
string.Format(whereSql, postValue)
|
||||
string.Format(whereSql, postWhereValue)
|
||||
)
|
||||
.OrderBy(
|
||||
orderByMapping.TryGetValue(postOrder, out var orderSql),
|
||||
|
||||
Reference in New Issue
Block a user