Skip to content

Commit de5804f

Browse files
Merge pull request #58 from magiccodingman/magiccodingman-patch-8
Update README.md
2 parents 17d376b + b4d585d commit de5804f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,13 @@ This documentation explains the various query capabilities available in the `Whe
132132
| `OrderBy(Expression<Func<T, object>> predicate)` | Orders the query result by the specified predicate in ascending order. |
133133
| `OrderByDescending(Expression<Func<T, object>> predicate)` | Orders the query result by the specified predicate in descending order. |
134134
| `Count()` | Get the number of items in the collection. |
135-
| `Execute()` | Executes the MagicQuery and returns the results as an `IEnumerable<T>`. |
135+
| `ToListAsync()` | Executes the MagicQuery and returns the results as `List<T>`. |
136+
| `{NOT YET SUPPORTED} AsEnumerable()` | (**FUTURE FEATURE**) Executes the MagicQuery and returns the results as `IEnumerable<T>`. |
137+
| `{NOT YET SUPPORTED} ToList()` | (**FUTURE FEATURE**) Executes the MagicQuery and returns the results as `List<T>`. |
138+
| `AsEnumerableAsync()` | Executes the MagicQuery and returns the results as `IEnumerable<T>`. |
136139

137-
These MagicQuery methods allow you to build complex queries similar to standard LINQ in C#. Remember to call the `Execute` method at the end of your MagicQuery to execute the query and retrieve the results.
140+
141+
These MagicQuery methods allow you to build complex queries similar to standard LINQ in C#. Remember to call the `ToListAsync` or the `AsEnumerableAsync` method at the end of your MagicQuery to execute the query and retrieve the full results.
138142

139143
## Standard Operations
140144

@@ -250,7 +254,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
250254
WhereExample = await manager.Where<Person>(x => x.Name.StartsWith("c", StringComparison.OrdinalIgnoreCase)
251255
|| x.Name.StartsWith("l", StringComparison.OrdinalIgnoreCase)
252256
|| x.Name.StartsWith("j", StringComparison.OrdinalIgnoreCase) && x._Age > 35
253-
).OrderBy(x => x._Id).Skip(1).Execute();
257+
).OrderBy(x => x._Id).Skip(1).ToListAsync();
254258

255259
StateHasChanged();
256260
}
@@ -298,13 +302,13 @@ foreach (Person person in allPeople)
298302

299303
## Querying Records
300304

301-
To query records based on specific conditions, use the `Where` method on the `DbManager` instance. You can chain additional LINQ methods, such as `OrderBy`, `Skip`, and `Execute`, to further refine your query. This example retrieves `Person` records that match certain criteria:
305+
To query records based on specific conditions, use the `Where` method on the `DbManager` instance. You can chain additional LINQ methods, such as `OrderBy`, `Skip`, and `ToListAsync`, to further refine your query. This example retrieves `Person` records that match certain criteria:
302306

303307
```csharp
304308
var whereExample = await manager.Where<Person>(x => x.Name.StartsWith("c", StringComparison.OrdinalIgnoreCase)
305309
|| x.Name.StartsWith("l", StringComparison.OrdinalIgnoreCase)
306310
|| x.Name.StartsWith("j", StringComparison.OrdinalIgnoreCase) && x._Age > 35
307-
).OrderBy(x => x._Id).Skip(1).Execute();
311+
).OrderBy(x => x._Id).Skip(1).ToListAsync();
308312
```
309313

310314
In this example, the query returns `Person` records where the `Name` property starts with "c", "l", or "j" (case-insensitive), and the `_Age` property is greater than 35. The results are ordered by the `_Id` property and the first record is skipped.

0 commit comments

Comments
 (0)