Skip to content

Commit c2119fd

Browse files
WhitWaldomsfussell
andauthored
Correcting .NET examples in the workflow docs (#4627)
Signed-off-by: Whit Waldo <[email protected]> Co-authored-by: Mark Fussell <[email protected]>
1 parent d476de5 commit c2119fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Do this:
232232
// Do this!!
233233
DateTime currentTime = context.CurrentUtcDateTime;
234234
Guid newIdentifier = context.NewGuid();
235-
string randomString = await context.CallActivityAsync<string>("GetRandomString");
235+
string randomString = await context.CallActivityAsync<string>(nameof("GetRandomString")); //Use "nameof" to prevent specifying an activity name that does not exist in your application
236236
```
237237

238238
{{% /codetab %}}
@@ -339,7 +339,7 @@ Do this:
339339
```csharp
340340
// Do this!!
341341
string configuration = workflowInput.Configuration; // imaginary workflow input argument
342-
string data = await context.CallActivityAsync<string>("MakeHttpCall", "https://example.com/api/data");
342+
string data = await context.CallActivityAsync<string>(nameof("MakeHttpCall"), "https://example.com/api/data");
343343
```
344344

345345
{{% /codetab %}}
@@ -439,7 +439,7 @@ Do this:
439439

440440
```csharp
441441
// Do this!!
442-
Task t = context.CallActivityAsync("DoSomething");
442+
Task t = context.CallActivityAsync(nameof("DoSomething"));
443443
await context.CreateTimer(5000).ConfigureAwait(true);
444444
```
445445

0 commit comments

Comments
 (0)