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.
|
Below is the working code block from the order processor's `Program.cs` file.
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
app.MapPost("/orders", async context => {
|
app.MapPost("/orders", (Order order) =>
|
||||||
var data = await context.Request.ReadFromJsonAsync<Order>();
|
{
|
||||||
Console.WriteLine("Order received : " + data);
|
Console.WriteLine("Order received : " + order);
|
||||||
await context.Response.WriteAsync(data.ToString());
|
return order.ToString();
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue