Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 2b480ad

Browse files
authored
Apply suggestions from code review
1 parent 1ad5a73 commit 2b480ad

12 files changed

+29
-10
lines changed

docs/reference/csharp/api/api-delete.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using Application = Nitric.Sdk.Nitric;
1717
var api = Application.Api("main");
1818

1919
api.Delete("/hello/:name", context => {
20-
var name = context.Req.PathParams.get("name");
20+
var name = context.Req.PathParams["name"];
2121

2222
context.Res.Text($"Deleting {name}!");
2323

@@ -56,7 +56,7 @@ using Application = Nitric.Sdk.Nitric;
5656
var api = Application.Api("main");
5757

5858
api.Delete("/hello/:name", context => {
59-
var name = context.Req.PathParams.get("name");
59+
var name = context.Req.PathParams["name"];
6060

6161
context.Res.Text($"Deleting {name}!");
6262

@@ -109,6 +109,7 @@ The DELETE request body is accessible from the `context.Req` object.
109109

110110
```csharp
111111
using Nitric.Sdk;
112+
using System.Collections.Generic;
112113

113114
var api = Nitric.Api("main");
114115

docs/reference/csharp/api/api-get.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using Application = Nitric.Sdk.Nitric;
1717
var api = Application.Api("main");
1818

1919
api.Get("/hello/:name", context => {
20-
var name = context.Req.PathParams.get("name");
20+
var name = context.Req.PathParams["name"];
2121

2222
context.Res.Text($"Getting {name}!");
2323

@@ -56,7 +56,7 @@ using Application = Nitric.Sdk.Nitric;
5656
var api = Application.Api("main");
5757

5858
api.Get("/hello/:name", context => {
59-
var name = context.Req.PathParams.get("name");
59+
var name = context.Req.PathParams["name"];
6060

6161
context.Res.Text($"Getting {name}!");
6262

docs/reference/csharp/api/api-patch.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using Application = Nitric.Sdk.Nitric;
1717
var api = Application.Api("main");
1818

1919
api.Patch("/hello/:name", context => {
20-
var name = context.Req.PathParams.get("name");
20+
var name = context.Req.PathParams["name"];
2121

2222
context.Res.Text($"Patching {name}!");
2323

@@ -56,7 +56,7 @@ using Application = Nitric.Sdk.Nitric;
5656
var api = Application.Api("main");
5757

5858
api.Patch("/hello/:name", context => {
59-
var name = context.Req.PathParams.get("name");
59+
var name = context.Req.PathParams["name"];
6060

6161
context.Res.Text($"Patching {name}!");
6262

@@ -109,6 +109,7 @@ The PATCH request body is accessible from the `context.Req` object.
109109

110110
```csharp
111111
using Application = Nitric.Sdk.Nitric;
112+
using System.Collections.Generic;
112113

113114
var api = Application.Api("main");
114115

docs/reference/csharp/api/api-post.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using Application = Nitric.Sdk.Nitric;
1717
var api = Application.Api("main");
1818

1919
api.Post("/hello/:name", context => {
20-
var name = context.Req.PathParams.get("name");
20+
var name = context.Req.PathParams["name"];
2121

2222
context.Res.Text($"Creating {name}!");
2323

@@ -56,7 +56,7 @@ using Application = Nitric.Sdk.Nitric;
5656
var api = Application.Api("main");
5757

5858
api.Post("/hello/:name", context => {
59-
var name = context.Req.PathParams.get("name");
59+
var name = context.Req.PathParams["name"];
6060

6161
context.Res.Text($"Creating {name}!");
6262

@@ -109,6 +109,7 @@ The POST request body is accessible from the `ctx.req` object.
109109

110110
```csharp
111111
using Application = Nitric.Sdk.Nitric;
112+
using System.Collections.Generic;
112113

113114
var api = Application.Api("main");
114115

docs/reference/csharp/api/api-put.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using Application = Nitric.Sdk.Nitric;
1717
var api = Application.Api("main");
1818

1919
api.Put("/hello/:name", context => {
20-
var name = context.Req.PathParams.get("name");
20+
var name = context.Req.PathParams["name"];
2121

2222
context.Res.Text($"Updating {name}!");
2323

@@ -56,7 +56,7 @@ using Application = Nitric.Sdk.Nitric;
5656
var api = Application.Api("main");
5757

5858
api.Put("/hello/:name", context => {
59-
var name = context.Req.PathParams.get("name");
59+
var name = context.Req.PathParams["name"];
6060

6161
context.Res.Text($"Updating {name}!");
6262

@@ -109,6 +109,7 @@ The PUT request body is accessible from the `ctx.req` object.
109109

110110
```csharp
111111
using Application = Nitric.Sdk.Nitric;
112+
using System.Collections.Generic;
112113

113114
var api = Application.Api("main");
114115

docs/reference/csharp/api/api-route-all.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Register a single handler for all HTTP Methods (GET, POST, PUT, DELETE, PATCH) o
88

99
```csharp
1010
using Application = Nitric.Sdk.Nitric;
11+
using System.Collections.Generic;
1112

1213
var route = Application.Api("main").Route("/customers");
1314

@@ -62,6 +63,7 @@ Application.Run();
6263

6364
```csharp
6465
using Application = Nitric.Sdk.Nitric;
66+
using System.Collections.Generic;
6567

6668
var route = Application.Api("main").Route("/customers");
6769

@@ -118,6 +120,7 @@ For methods that include a request body, such as `POST` and `PUT`, you can acces
118120

119121
```csharp
120122
using Application = Nitric.Sdk.Nitric;
123+
using System.Collections.Generic;
121124

122125
var route = Application.Api("main").Route("/customers");
123126

docs/reference/csharp/api/api-route-delete.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Register a handler for HTTP DELETE requests to the route.
88

99
```csharp
1010
using Application = Nitric.Sdk.Nitric;
11+
using System.Collections.Generic;
1112

1213
var route = Application.Api("main").Route("/customers");
1314

@@ -47,6 +48,7 @@ Application.Run();
4748

4849
```csharp
4950
using Application = Nitric.Sdk.Nitric;
51+
using System.Collections.Generic;
5052

5153
var route = Application.Api("main").Route("/customers");
5254

@@ -103,6 +105,7 @@ The DELETE request body is accessible from the `ctx.req` object.
103105

104106
```csharp
105107
using Application = Nitric.Sdk.Nitric;
108+
using System.Collections.Generic;
106109

107110
var route = Application.Api("main").Route("/customers");
108111

docs/reference/csharp/api/api-route-get.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Register a handler for HTTP GET requests to the route.
88

99
```csharp
1010
using Application = Nitric.Sdk.Nitric;
11+
using System.Collections.Generic;
1112

1213
var route = Application.Api("main").Route("/customers");
1314

@@ -47,6 +48,7 @@ Application.Run();
4748

4849
```csharp
4950
using Application = Nitric.Sdk.Nitric;
51+
using System.Collections.Generic;
5052

5153
var route = Application.Api("main").Route("/customers");
5254

docs/reference/csharp/api/api-route-patch.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ The PATCH request body is accessible from the `context.Req` object.
105105

106106
```csharp
107107
using Application = Nitric.Sdk.Application;
108+
using System.Collections.Generic;
108109

109110
var api = Application.Api("main").Route("/customers");
110111

docs/reference/csharp/api/api-route-post.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Register a handler for HTTP POST requests to the route.
88

99
```csharp
1010
using Application = Nitric.Sdk.Nitric;
11+
using System.Collections.Generic;
1112

1213
var route = Application.Api("main").Route("/customers");
1314

@@ -47,6 +48,7 @@ Application.Run();
4748

4849
```csharp
4950
using Application = Nitric.Sdk.Nitric;
51+
using System.Collections.Generic;
5052

5153
var route = Application.Api("main").Route("/customers");
5254

@@ -103,6 +105,7 @@ The POST request body is accessible from the `ctx.req` object.
103105

104106
```csharp
105107
using Application = Nitric.Sdk.Nitric;
108+
using System.Collections.Generic;
106109

107110
var route = Application.Api("main").Route("/customers");
108111

0 commit comments

Comments
 (0)