Update Sample17

This commit is contained in:
Sipke Schoorstra 2019-10-24 20:51:41 +02:00
parent 75e89b6593
commit 0ea4cd3671
2 changed files with 7 additions and 2 deletions

View file

@ -3,5 +3,7 @@
public class Document
{
public string Title { get; set; }
public override string ToString() => Title;
}
}

View file

@ -4,6 +4,7 @@ using Elsa.Activities.Console.Extensions;
using Elsa.Services;
using Microsoft.Extensions.DependencyInjection;
using Sample17.Activities;
using Sample17.Models;
namespace Sample17
{
@ -13,8 +14,10 @@ namespace Sample17
{
var services = BuildServices();
var workflowInvoker = services.GetRequiredService<IWorkflowInvoker>();
await workflowInvoker.StartAsync<CreateDocumentWorkflow>();
var workflow = await workflowInvoker.StartAsync<CreateDocumentWorkflow>();
var document = workflow.CurrentScope.GetVariable<Document>("Document");
Console.WriteLine("Created document: {0}", document);
}
private static IServiceProvider BuildServices()