diff --git a/README.md b/README.md index 8673591..6f916da 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PowerPipe: A .NET Library for Constructing Advanced Pipelines with Fluent Interface +# PowerPipe: A .NET Library for Constructing Advanced Workflows with Fluent Interface @@ -80,12 +80,12 @@ dotnet add package PowerPipe.Extensions.MicrosoftDependencyInjection ```csharp public class SampleContext : PipelineContext { - // Properties and methods specific to the context + // Properties and methods specific to the context } public class SampleResult { - // Implementation details + // Implementation details } ``` @@ -94,12 +94,12 @@ public class SampleResult ```csharp public class SampleStep1 : IPipelineStep { - // Implementation details… + // Implementation details… } public class SampleStep2 : IPipelineStep { - // Implementation details… + // Implementation details… } ``` @@ -109,9 +109,9 @@ public class SampleStep2 : IPipelineStep ```csharp var pipeline = new PipelineBuilder() - .Add() - .Add() - .Build(); + .Add() + .Add() + .Build(); ``` - Use `AddIf` method to add a step to the pipeline based on the predicate @@ -119,36 +119,36 @@ var pipeline = new PipelineBuilder() ```csharp // Define predicate based on context private bool ExecuteStep2(OrderProcessingContext context) => - context.ExecuteStep2Allowed; + context.ExecuteStep2Allowed; var pipeline = new PipelineBuilder() - .Add() - .AddIf(ExecuteStep2) - .Build(); + .Add() + .AddIf(ExecuteStep2) + .Build(); ``` - Use `AddIfElse` method to add one of the steps by the predicate ```csharp private bool ExecuteStep2(OrderProcessingContext context) => - context.ExecuteStep2Allowed; + context.ExecuteStep2Allowed; var pipeline = new PipelineBuilder() - .AddIfElse(ExecuteStep2) - .Build(); + .AddIfElse(ExecuteStep2) + .Build(); ``` - Use `If` method to add a nested pipeline based on a predicate ```csharp private bool ExecuteNestedPipeline(OrderProcessingContext context) => - context.ExecuteNestedPipelineAllowed; + context.ExecuteNestedPipelineAllowed; var pipeline = new PipelineBuilder() - .If(ExecuteNestedPipeline, b => b - .Add() - .Add()) - .Build(); + .If(ExecuteNestedPipeline, b => b + .Add() + .Add()) + .Build(); ``` - Use `Parallel` method to execute your steps in parallel @@ -157,10 +157,10 @@ var pipeline = new PipelineBuilder() ```csharp var pipeline = new PipelineBuilder() - .Parallel(b => b - .Add() - .Add(), maxDegreeOfParallelism: 3) - .Build(); + .Parallel(b => b + .Add() + .Add(), maxDegreeOfParallelism: 3) + .Build(); ``` - Use `OnError` method to add error-handling behavior @@ -169,9 +169,9 @@ var pipeline = new PipelineBuilder() ```csharp var pipeline = new PipelineBuilder() - .Add() - .OnError(PipelineStepErrorHandling.Retry) - .Build(); + .Add() + .OnError(PipelineStepErrorHandling.Retry) + .Build(); ``` - Use `CompensateWith` method to add a compensation step to the previously added step in the pipeline @@ -182,9 +182,9 @@ var pipeline = new PipelineBuilder() public class SampleStep1Compensation : IPipelineCompensationStep {} var pipeline = new PipelineBuilder() - .Add() - .CompensateWith() - .Build(); + .Add() + .CompensateWith() + .Build(); ``` 4. **Extensions: Microsoft Dependency Injection** @@ -200,11 +200,11 @@ public static IServiceCollection AddPowerPipe(this IServiceCollection serviceCol ```csharp services - .AddPowerPipeStep() - .AddPowerPipeParallelStep() - .AddPowerPipeCompensationStep() - // other steps ... - ; + .AddPowerPipeStep() + .AddPowerPipeParallelStep() + .AddPowerPipeCompensationStep() + // other steps ... + ; ``` Check out [sample project](samples/PowerPipe.Sample) 👀