update csharp code snippet

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
This commit is contained in:
Hannah Hunter 2023-02-14 13:17:15 -06:00
parent 451c5cfd8a
commit 1e495c8060
1 changed files with 5 additions and 4 deletions

View File

@ -305,11 +305,12 @@ dapr run --app-port 7001 --app-id order-processor --app-protocol http --dapr-htt
```
Below is the working code block from the order processor's `Program.cs` file.
```csharp
app.MapPost("/orders", async context => {
var data = await context.Request.ReadFromJsonAsync<Order>();
Console.WriteLine("Order received : " + data);
await context.Response.WriteAsync(data.ToString());
app.MapPost("/orders", (Order order) =>
{
Console.WriteLine("Order received : " + order);
return order.ToString();
});
```