mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-05 16:00:52 +08:00
Merge branch 'master' of https://github.com/dotnetcore/FreeSql.wiki
4
表达式函数.md
4
表达式函数.md
@@ -5,14 +5,14 @@
|
|||||||
|
|
||||||
示例
|
示例
|
||||||
```csharp
|
```csharp
|
||||||
Expression<Func<T, bool>> where = a => a.id == Guid.Empty;
|
Expression<Func<T, bool>> where = null;
|
||||||
where = where.And(b => b.num > 0);
|
where = where.And(b => b.num > 0);
|
||||||
where = where.Or(b => b.num > 0);
|
where = where.Or(b => b.num > 0);
|
||||||
```
|
```
|
||||||
|
|
||||||
动态拼接``Or``,通过``Or``扩展方法动态拼接``Lambda``表达式
|
动态拼接``Or``,通过``Or``扩展方法动态拼接``Lambda``表达式
|
||||||
```csharp
|
```csharp
|
||||||
Expression<Func<T, bool>> where = a => null;
|
Expression<Func<T, bool>> where = null;
|
||||||
if (xxx)
|
if (xxx)
|
||||||
{
|
{
|
||||||
where = where.Or(b => b.num > 0);
|
where = where.Or(b => b.num > 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user