elsa-core/samples/Sample01/Program.cs
Sipke Schoorstra 7fb6153e0a
Refactored versioning (#67)
* Fix StringValues serialization and rename WorkflowDefinition to WorkflowDefinitionVersion

* Fix Singleton issue and add support for absolute URL using base URL for background tasks

* Fix persistence and lifetime scope issues

* Fix timer bugs

* Various bug fixes
2019-09-15 12:16:24 +02:00

33 lines
977 B
C#

using System;
using System.Threading.Tasks;
using Elsa.Extensions;
using Elsa.Persistence.Memory;
using Elsa.Services;
using Microsoft.Extensions.DependencyInjection;
using Sample01.Activities;
namespace Sample01
{
/// <summary>
/// A minimal workflows program defined in code with a strongly-typed workflow class.
/// </summary>
class Program
{
static async Task Main(string[] args)
{
// Setup a service collection.
var services = new ServiceCollection()
.AddWorkflows()
.AddMemoryWorkflowInstanceStore()
.AddActivity<HelloWorld>()
.AddActivity<GoodByeWorld>()
.BuildServiceProvider();
// Invoke the workflow.
var invoker = services.GetService<IWorkflowInvoker>();
await invoker.StartAsync<HelloWorldWorkflow>();
Console.ReadLine();
}
}
}