File tree 2 files changed +14
-2
lines changed
src/samples/WorkflowCore.Sample01
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 5
5
using System . Linq ;
6
6
using System . Threading . Tasks ;
7
7
using WorkflowCore . Interface ;
8
+ using WorkflowCore . Sample01 . Steps ;
8
9
using WorkflowCore . Services ;
9
10
10
11
namespace WorkflowCore . Sample01
@@ -32,7 +33,8 @@ private static IServiceProvider ConfigureServices()
32
33
//setup dependency injection
33
34
IServiceCollection services = new ServiceCollection ( ) ;
34
35
services . AddLogging ( ) ;
35
- //services.AddWorkflow(x => x.UseSqlServer(@"Server=.;Database=WorkflowCore;Trusted_Connection=True;"));
36
+ services . AddWorkflow ( ) ;
37
+ services . AddTransient < GoodbyeWorld > ( ) ;
36
38
37
39
var serviceProvider = services . BuildServiceProvider ( ) ;
38
40
Original file line number Diff line number Diff line change 1
- using System ;
1
+ using Microsoft . Extensions . Logging ;
2
+ using System ;
2
3
using System . Collections . Generic ;
3
4
using System . Linq ;
4
5
using System . Threading . Tasks ;
@@ -9,9 +10,18 @@ namespace WorkflowCore.Sample01.Steps
9
10
{
10
11
public class GoodbyeWorld : StepBody
11
12
{
13
+
14
+ private ILogger _logger ;
15
+
16
+ public GoodbyeWorld ( ILoggerFactory loggerFactory )
17
+ {
18
+ _logger = loggerFactory . CreateLogger < GoodbyeWorld > ( ) ;
19
+ }
20
+
12
21
public override ExecutionResult Run ( IStepExecutionContext context )
13
22
{
14
23
Console . WriteLine ( "Goodbye world" ) ;
24
+ _logger . LogInformation ( "Hi there!" ) ;
15
25
return ExecutionResult . Next ( ) ;
16
26
}
17
27
}
You can’t perform that action at this time.
0 commit comments