Last active
September 4, 2019 11:45
-
-
Save marcduiker/0a841a123b103acbcd5fe96437b87084 to your computer and use it in GitHub Desktop.
Example of using string constants in a static class in order to use these in the [FunctionName] attribute (activity function) and in the CallActivityAsync() method (orchestration function).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DurableFunctions.Demo.DotNetCore.Basics | |
{ | |
public static class FunctionName | |
{ | |
public const string HelloNameActivity = "HelloNameActivity"; | |
public const string HelloNameOrchestration = "HelloNameOrchestration"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DurableFunctions.Demo.DotNetCore.Basics.Activities | |
{ | |
public static class HelloNameActivity | |
{ | |
[FunctionName(FunctionName.HelloNameActivity)] | |
public static string Run( | |
[ActivityTrigger] string name, | |
ILogger logger) | |
{ | |
logger.LogInformation($"Name: {name}"); | |
return $"Hello {name}!"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment