Updated 表达式函数 (markdown)

IGeekFan
2020-11-30 20:18:25 +08:00
parent cbb45b19a6
commit 6bbe723eac

@@ -1,5 +1,24 @@
这是 FreeSql 非常特色的功能之一,深入细化函数解析,所支持的类型基本都可以使用对应的表达式函数,例如 日期、字符串、IN查询、数组PostgreSQL的数组、字典PostgreSQL HStore)等等。
## 动态Lambda表达式
- And、Or扩展方法 [LambadaExpressionExtensions.cs](https://github.com/dotnetcore/FreeSql/blob/master/FreeSql/Extensions/LambadaExpressionExtensions.cs)
示例
```
Expression<Func<T, bool>> where = a => a.id == Guid.Empty;
where = where.And(b => b.num > 0);
where = where.Or(b => b.num > 0);
```
动态拼Or.先搞个false条件 然后拼Lambda条件
```
Expression<Func<T, bool>> where = a =>false;
if(xxx)
{
where = where.Or(b => b.num > 0);
}
```
## In查询
```csharp