Update serviceinvocation-quickstart.md

Signed-off-by: Minh Luan Quach <61050316+louisquach@users.noreply.github.com>
This commit is contained in:
Minh Luan Quach 2023-02-08 11:48:38 +08:00 committed by GitHub
parent 75109bf8a1
commit 5aaee9cb2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -304,6 +304,7 @@ Run the `order-processor` service alongside a Dapr sidecar.
dapr run --app-port 7001 --app-id order-processor --app-protocol http --dapr-http-port 3501 -- dotnet run
```
Add this code block to the Program.cs file in the current directory
```csharp
app.MapPost("/orders", async context => {
var data = await context.Request.ReadFromJsonAsync<Order>();
@ -334,7 +335,7 @@ Run the `checkout` service alongside a Dapr sidecar.
dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 -- dotnet run
```
In the `checkout` service, you'll notice there's no need to rewrite your app code to use Dapr's service invocation. You can enable service invocation by simply adding the `dapr-app-id` header, which specifies the ID of the target service.
In the Program.cs file inside `checkout` service, you'll notice there's no need to rewrite your app code to use Dapr's service invocation. You can enable service invocation by simply adding the `dapr-app-id` header, which specifies the ID of the target service.
```csharp
var client = new HttpClient();