You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Note: MongoDB handles these as regular expressions (.*pattern or pattern.*) automatically.
150
+
```
151
+
152
+
### Implicit Booleans
153
+
154
+
You can natively pass `TBool` fields directly into the lambda constraint, mimicking standard .NET semantics.
155
+
156
+
```csharp
157
+
conn.Query<Product>().Where(p=>p.IsActive)
158
+
// → WHERE IsActive = 1
159
+
```
160
+
132
161
### Captured local variables
133
162
134
163
```csharp
@@ -176,6 +205,40 @@ Without `Skip`/`Take`, execution uses `conn.LazyQueryAll(...)` for memory-effici
176
205
177
206
---
178
207
208
+
## Scalar & Terminal Methods
209
+
210
+
ActiveForge supports invoking terminal scalar executors directly on the query, compiling immediately and sending a constrained scalar demand to the DB.
Anonymous type projection parses requested properties to prune the retrieved columns securely at the database level by evaluating a tailored `FieldSubset`.
228
+
229
+
```csharp
230
+
// The SQL executed will ONLY 'SELECT p.Id, p.Name FROM Products p'
231
+
varlightweightList=conn.Query<Product>()
232
+
.Where(p=>p.IsActive)
233
+
.Select(p=>new {
234
+
p.ID,
235
+
p.Name
236
+
})
237
+
.ToList();
238
+
```
239
+
240
+
---
241
+
179
242
## Lazy Enumeration
180
243
181
244
`IQueryable<T>` is lazy — the database is not queried until you start iterating:
@@ -312,8 +375,6 @@ The expression tree is traversed **at execution time**, so local variables are c
312
375
|------------|-------|
313
376
| No `GroupBy`| Not supported; use raw SQL or `ExecSQL`. |
314
377
| No `Join` clause | Cross-join predicates and sorts work via embedded `Record` fields. See [joins.md](joins.md). |
315
-
| No `Select` projection | Returns full typed `Record` instances; field subsets can be applied at the `conn.Query<T>(template)` level. |
316
-
| No `Count()`, `First()`, etc. | Call the standard ORM methods (`conn.QueryCount(...)`, `conn.QueryFirst(...)`) directly. |
317
378
| No async support | Use the synchronous API; async is planned for a future release. |
ActiveForge supports invoking terminal scalar executors directly on the query, compiling immediately and sending a constrained scalar demand to the DB.
Anonymous type projection parses requested properties to prune the retrieved columns securely at the database level by evaluating a tailored `FieldSubset`.
828
+
829
+
```csharp
830
+
// The SQL executed will ONLY 'SELECT p.Id, p.Name FROM Products p'
831
+
varlightweightList=conn.Query<Product>()
832
+
.Where(p=>p.IsActive)
833
+
.Select(p=>new {
834
+
p.ID,
835
+
p.Name
836
+
})
837
+
.ToList();
838
+
```
839
+
840
+
### 9.10 Limitations
782
841
783
842
| Limitation | Workaround |
784
843
|------------|-----------|
785
844
| No `GroupBy`| Use raw SQL (`ExecSQL`) |
786
845
| No `Join`| Use embedded `Record` fields |
787
-
| No `Select` projection | Use `FieldSubset` on template |
788
-
| No `Count()`, `First()`| Use `conn.QueryCount()`, `conn.QueryFirst()`|
return$"SELECT {fields} FROM {ResolveFullyQualifiedName(binding.SourceName,binding.Function)}{binding.GetRootAlias()}{joins} WHERE {criteria} FOR UPDATE";
0 commit comments