elsa-core/src/samples/console/Elsa.Samples.HelloWorldConsole/Program.cs
Sipke Schoorstra 0facd8f93f
Introduce activity type providers (#480)
* Add activity type provider API

* Rename ReceiveHttpRequest to HttpRequestReceived
2020-11-30 15:21:36 +01:00

31 lines
1,017 B
C#

using System.Threading.Tasks;
using Elsa.Extensions;
using Elsa.Services;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Samples.HelloWorldConsole
{
class Program
{
private static async Task Main()
{
// Create a service container with Elsa services.
var services = new ServiceCollection()
.AddElsa()
.AddConsoleActivities()
.AddWorkflow<HelloWorld>()
.AddAutoMapperProfiles<Program>()
.BuildServiceProvider();
// Run startup actions (not needed when registering Elsa with a Host).
var startupRunner = services.GetRequiredService<IStartupRunner>();
await startupRunner.StartupAsync();
// Get a workflow runner.
var workflowRunner = services.GetRequiredService<IWorkflowRunner>();
// Run the workflow.
await workflowRunner.RunWorkflowAsync<HelloWorld>();
}
}
}