Skip to content

Commit 4f00afa

Browse files
committed
Fix README
1 parent 46e77e0 commit 4f00afa

File tree

1 file changed

+6
-34
lines changed

1 file changed

+6
-34
lines changed

README.md

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Or via the .NET Core command line interface:
1212

1313
dotnet add package Pipr
1414

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.
1617

1718
### Usage
1819

@@ -53,40 +54,10 @@ var result = pipeline.Execute(12);
5354

5455
The in/out of the pipeline can be inferred by the type system as you add steps.
5556

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)
66-
serviceCollection.AddTransient<DoublerStep>();
67-
68-
serviceCollection.AddPipr();
69-
...
70-
71-
```
72-
73-
Then create and use pipelines like so:
74-
75-
```
76-
var pipeline = new PipelineBuilder()
77-
.AddStep(PipelineBuilder.UseService<ToStringStep>())
78-
.AddStep(PipelineBuilder.UseService<DoublerStep>())
79-
.AddStep(PipelineBuilder.UseService<DoublerStep>())
80-
.Build();
81-
82-
var result = pipeline.Execute(12);
83-
```
84-
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-
8757
#### Aborting
8858

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()`:
9061

9162
For example
9263

@@ -101,4 +72,5 @@ public class CancellingStep : IStep<string, string>
10172
}
10273
```
10374

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

Comments
 (0)