Correcting .NET examples in the workflow docs (#4627)

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Co-authored-by: Mark Fussell <markfussell@gmail.com>
This commit is contained in:
Whit Waldo 2025-05-15 17:14:03 -05:00 committed by GitHub
parent d476de5444
commit c2119fdd43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -232,7 +232,7 @@ Do this:
// Do this!!
DateTime currentTime = context.CurrentUtcDateTime;
Guid newIdentifier = context.NewGuid();
string randomString = await context.CallActivityAsync<string>("GetRandomString");
string randomString = await context.CallActivityAsync<string>(nameof("GetRandomString")); //Use "nameof" to prevent specifying an activity name that does not exist in your application
```
{{% /codetab %}}
@ -339,7 +339,7 @@ Do this:
```csharp
// Do this!!
string configuration = workflowInput.Configuration; // imaginary workflow input argument
string data = await context.CallActivityAsync<string>("MakeHttpCall", "https://example.com/api/data");
string data = await context.CallActivityAsync<string>(nameof("MakeHttpCall"), "https://example.com/api/data");
```
{{% /codetab %}}
@ -439,7 +439,7 @@ Do this:
```csharp
// Do this!!
Task t = context.CallActivityAsync("DoSomething");
Task t = context.CallActivityAsync(nameof("DoSomething"));
await context.CreateTimer(5000).ConfigureAwait(true);
```