Skip to content

Commit a648926

Browse files
committed
List example projects in documentation
1 parent 118e7b0 commit a648926

File tree

2 files changed

+32
-20
lines changed

2 files changed

+32
-20
lines changed

docs/request-examples/README.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22

33
To update these requests:
44

5-
1. Add a PowerShell (.ps1) script prefixed by a number that is used to determine the order the scripts are executed. The script should execute a request and output the response. Example:
6-
```
7-
curl -s http://localhost:14141/api/books
8-
```
5+
1. Add a PowerShell (`.ps1`) script prefixed by a number that is used to determine the order the scripts are executed.
6+
The script should execute a request and output the response. For example:
7+
```
8+
curl -s http://localhost:14141/api/books
9+
```
910

10-
2. Add the example to `index.md`. Example:
11-
```
12-
### Get with relationship
11+
2. Add the example to `index.md`. For example:
12+
```
13+
### Get with relationship
1314
14-
[!code-ps[REQUEST](003_GET_Books-including-Author.ps1)]
15-
[!code-json[RESPONSE](003_GET_Books-including-Author_Response.json)]
16-
```
15+
[!code-ps[REQUEST](003_GET_Books-including-Author.ps1)]
16+
[!code-json[RESPONSE](003_GET_Books-including-Author_Response.json)]
17+
```
1718

18-
3. Run `pwsh ../generate-examples.ps1`
19-
4. Verify the results by running `pwsh ../build-dev.ps1`
19+
3. Run `pwsh ../generate-examples.ps1` to execute the request.
20+
21+
4. Run `pwsh ../build-dev.ps1` to view the output on the website.

docs/request-examples/index.md

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
1-
---
2-
_disableToc: true
3-
---
1+
# Example projects
42

5-
# Example requests
3+
Runnable example projects can be found [here](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/src/Examples):
4+
5+
- GettingStarted: A simple project with minimal configuration to have a runnable project in minutes.
6+
- JsonApiDotNetCoreExample: Showcases commonly-used features, such as resource definitions, atomic operations, and OpenAPI.
7+
- OpenApiNSwagClientExample: Uses [NSwag](https://github.com/RicoSuter/NSwag) to generate a typed OpenAPI client.
8+
- OpenApiKiotaClientExample: Uses [Kiota](https://learn.microsoft.com/en-us/openapi/kiota/) to generate a typed OpenAPI client.
9+
- MultiDbContextExample: Shows how to use multiple `DbContext` classes, for connecting to multiple databases.
10+
- DatabasePerTenantExample: Uses a different database per tenant. See [here](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/test/JsonApiDotNetCoreTests/IntegrationTests/MultiTenancy) for using multiple tenants in the same database.
11+
- NoEntityFrameworkExample: Uses a read-only in-memory repository instead of a real database.
12+
- DapperExample: Uses [Dapper](https://github.com/DapperLib/Dapper) to execute SQL queries.
13+
- ReportsExample: Uses a resource service that returns aggregated data.
614

7-
These requests have been generated against the "GettingStarted" application and are updated on every deployment.
15+
Additional use cases are provided as integration tests [here](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/test/JsonApiDotNetCoreTests/IntegrationTests).
16+
17+
# Example requests
818

9-
All of these requests have been created using out-of-the-box features.
19+
The following requests are automatically generated against the "GettingStarted" application on every deployment.
1020

1121
> [!NOTE]
1222
> curl requires "[" and "]" in URLs to be escaped.
1323
14-
# Reading data
24+
## Reading data
1525

1626
### Get all
1727

@@ -48,7 +58,7 @@ All of these requests have been created using out-of-the-box features.
4858
[!code-ps[REQUEST](007_GET_Books-paginated.ps1)]
4959
[!code-json[RESPONSE](007_GET_Books-paginated_Response.json)]
5060

51-
# Writing data
61+
## Writing data
5262

5363
### Create resource
5464

0 commit comments

Comments
 (0)