Skip to content

Commit 0e13848

Browse files
committed
sample
1 parent 56a7799 commit 0e13848

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/samples/WorkflowCore.Sample01/Program.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Linq;
66
using System.Threading.Tasks;
77
using WorkflowCore.Interface;
8+
using WorkflowCore.Sample01.Steps;
89
using WorkflowCore.Services;
910

1011
namespace WorkflowCore.Sample01
@@ -32,7 +33,8 @@ private static IServiceProvider ConfigureServices()
3233
//setup dependency injection
3334
IServiceCollection services = new ServiceCollection();
3435
services.AddLogging();
35-
//services.AddWorkflow(x => x.UseSqlServer(@"Server=.;Database=WorkflowCore;Trusted_Connection=True;"));
36+
services.AddWorkflow();
37+
services.AddTransient<GoodbyeWorld>();
3638

3739
var serviceProvider = services.BuildServiceProvider();
3840

src/samples/WorkflowCore.Sample01/Steps/GoodbyeWorld.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using Microsoft.Extensions.Logging;
2+
using System;
23
using System.Collections.Generic;
34
using System.Linq;
45
using System.Threading.Tasks;
@@ -9,9 +10,18 @@ namespace WorkflowCore.Sample01.Steps
910
{
1011
public class GoodbyeWorld : StepBody
1112
{
13+
14+
private ILogger _logger;
15+
16+
public GoodbyeWorld(ILoggerFactory loggerFactory)
17+
{
18+
_logger = loggerFactory.CreateLogger<GoodbyeWorld>();
19+
}
20+
1221
public override ExecutionResult Run(IStepExecutionContext context)
1322
{
1423
Console.WriteLine("Goodbye world");
24+
_logger.LogInformation("Hi there!");
1525
return ExecutionResult.Next();
1626
}
1727
}

0 commit comments

Comments
 (0)