Skip to content

Commit dd8749c

Browse files
authored
Removed tabs in code sample
1 parent 06ba5ef commit dd8749c

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

docs/06-authentication-and-authorization.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -288,21 +288,19 @@ public partial class OrderContext : JsonSerializerContext {}
288288
You can now optimize the calls to the HttpClient in the `OrdersClient` class by passing an `OrderContext.Default` parameter pointing to the type sought as the second parameter. Updating the methods in the `OrdersClient` class should look like the following:
289289

290290
```csharp
291-
public async Task<IEnumerable<OrderWithStatus>> GetOrders() =>
292-
await httpClient.GetFromJsonAsync("orders", OrderContext.Default.ListOrderWithStatus);
291+
public async Task<IEnumerable<OrderWithStatus>> GetOrders() =>
292+
await httpClient.GetFromJsonAsync("orders", OrderContext.Default.ListOrderWithStatus);
293293

294+
public async Task<OrderWithStatus> GetOrder(int orderId) =>
295+
await httpClient.GetFromJsonAsync($"orders/{orderId}", OrderContext.Default.OrderWithStatus);
294296

295-
public async Task<OrderWithStatus> GetOrder(int orderId) =>
296-
await httpClient.GetFromJsonAsync($"orders/{orderId}", OrderContext.Default.OrderWithStatus);
297-
298-
299-
public async Task<int> PlaceOrder(Order order)
300-
{
301-
var response = await httpClient.PostAsJsonAsync("orders", order, OrderContext.Default.Order);
302-
response.EnsureSuccessStatusCode();
303-
var orderId = await response.Content.ReadFromJsonAsync<int>();
304-
return orderId;
305-
}
297+
public async Task<int> PlaceOrder(Order order)
298+
{
299+
var response = await httpClient.PostAsJsonAsync("orders", order, OrderContext.Default.Order);
300+
response.EnsureSuccessStatusCode();
301+
var orderId = await response.Content.ReadFromJsonAsync<int>();
302+
return orderId;
303+
}
306304
```
307305

308306
### Deploy OrdersClient to pages

0 commit comments

Comments
 (0)