Skip to content

Commit f083ed5

Browse files
update readme
1 parent 5d64310 commit f083ed5

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,33 +46,46 @@ var compiler = new SqlCompiler();
4646
var db = new QueryFactory(connection, compiler);
4747
```
4848

49-
### Get all records
49+
### Retrieve all records
5050
```cs
5151
var books = db.Query("Books").Get();
5252
```
5353

54-
### Published books only
54+
### Retrieve published books only
5555
```cs
5656
var books = db.Query("Books").WhereTrue("IsPublished").Get();
5757
```
5858

59-
### Get one book by Id
59+
### Retrieve one book
6060
```cs
6161
var introToSql = db.Query("Books").Where("Id", 145).Where("Lang", "en").First();
6262
```
6363

64-
### Recent books: last 10
64+
### Retrieve recent books: last 10
6565
```cs
6666
var recent = db.Query("Books").OrderByDesc("PublishedAt").Limit(10).Get();
6767
```
6868

6969
### Include Author information
7070
```cs
7171
var books = db.Query("Books")
72-
.Incluce(db.Query("Authors")) // Assumes that the Books table have a `AuthorId` column
72+
.Include(db.Query("Authors")) // Assumes that the Books table have a `AuthorId` column
7373
.Get();
7474
```
7575

76+
This will include the property "Author" on each "Book"
77+
```json
78+
[{
79+
"Id": 1,
80+
"PublishedAt": "2019-01-01",
81+
"AuthorId": 2
82+
"Author": { // <-- included property
83+
"Id": 2,
84+
"...": ""
85+
}
86+
}]
87+
```
88+
7689
### Join with authors table
7790

7891
```cs

0 commit comments

Comments
 (0)