C#
In this section, we cover some of the built-in variables and functions available to the C# expression syntax.
Installing the C# Feature
dotnet package add Elsa.CSharpservices.AddElsa(elsa =>
{
elsa.UseCSharp();
});Configuration
services.AddElsa(elsa =>
{
elsa.UseCSharp(options =>
{
// Make available additional assemblies.
options.Assemblies.Add(GetType().Assembly);
// Make available additional assemblies.
options.Namespaces.Add(typeof(MyEntity).Namespace!);
// Register a global method called 'Greet'.
options.AppendScript("string Greet(string name) => $\"Hello {name}!\";");
});
});Globals
WorkflowInstanceId
CorrelationId
Variable
Output
Input
Adding Assemblies and Namespaces
Last updated