You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-34Lines changed: 6 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,8 @@ Or via the .NET Core command line interface:
12
12
13
13
dotnet add package Pipr
14
14
15
-
Either commands, from Package Manager Console or .NET Core CLI, will download and install Pipr and all required dependencies.
15
+
Either commands, from Package Manager Console or .NET Core CLI, will download
16
+
and install Pipr and all required dependencies.
16
17
17
18
### Usage
18
19
@@ -53,40 +54,10 @@ var result = pipeline.Execute(12);
53
54
54
55
The in/out of the pipeline can be inferred by the type system as you add steps.
55
56
56
-
#### Dependency Injection
57
-
58
-
You can also have Pipr create your objects for you using the IServiceProvider from `Microsoft.Extensions.DependencyInjection` if you specify the type and the inputs and outputs as you build the pipeline and configure on startup.
59
-
60
-
In Startup.cs:
61
-
62
-
```
63
-
...
64
-
65
-
serviceCollection.AddTransient<ToStringStep>(); // (example, doesn't have to be Transient lifetime)
The `PipelineBuilder.UseService<T>()` method doesn't really do anything but return default(T). This just lets us have nicer syntax for configuring without having to pass in all of the in/out types and still use dependency injection.
85
-
86
-
87
57
#### Aborting
88
58
89
-
Pipeline steps can cancel and abort further processing by calling `context.Cancel()`:
59
+
Pipeline steps can cancel and abort further processing by calling
60
+
`context.Cancel()`:
90
61
91
62
For example
92
63
@@ -101,4 +72,5 @@ public class CancellingStep : IStep<string, string>
101
72
}
102
73
```
103
74
104
-
If a step cancels further processing, no following steps will run, and the pipeline return value will be the default value for the return type.
75
+
If a step cancels further processing, no following steps will run, and the
76
+
pipeline return value will be the default value for the return type.
0 commit comments