mirror of https://github.com/dapr/docs.git
update csharp code snippet
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
This commit is contained in:
parent
451c5cfd8a
commit
1e495c8060
|
@ -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();
|
||||
});
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue