Skip to content

Commit c970d68

Browse files
authored
Fix DaprWorkflowClient injection and scope usage
Signed-off-by: Marc Duiker <marcduiker@users.noreply.github.com>
1 parent e9f849d commit c970d68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sdkdocs/dotnet/content/en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflowclient-usage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ In an ASP.Net Core application, you can inject the `DaprWorkflowClient` into met
8787

8888
```csharp
8989
app.MapPost("/start", async (
90-
DaprWorkflowClient daprWorkflowClient,
90+
[FromServices] DaprWorkflowClient daprWorkflowClient,
9191
Order order
9292
) => {
9393
var instanceId = await daprWorkflowClient.ScheduleNewWorkflowAsync(
@@ -105,7 +105,7 @@ app.MapPost("/start", async (
105105
To create a `DaprWorkflowClient` instance in a console app, retrieve it from the `ServiceProvider`:
106106

107107
```csharp
108-
await using var scope = host.Services.CreateAsyncScope();
108+
using var scope = host.Services.CreateAsyncScope();
109109
var daprWorkflowClient = scope.ServiceProvider.GetRequiredService<DaprWorkflowClient>();
110110
```
111111

@@ -177,4 +177,4 @@ public class OrderProcessingWorkflow : Workflow<OrderPayload, OrderResult>
177177
## Next steps
178178

179179
- [Learn more about Dapr workflow management operations]({{% ref dotnet-workflow-management-methods.md %}})
180-
- [Learn how to author workflows and activities]({{% ref howto-author-workflow.md %}})
180+
- [Learn how to author workflows and activities]({{% ref howto-author-workflow.md %}})

0 commit comments

Comments
 (0)