MyTrout.Pipelines.Hosting
4.1.0
dotnet add package MyTrout.Pipelines.Hosting --version 4.1.0
NuGet\Install-Package MyTrout.Pipelines.Hosting -Version 4.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MyTrout.Pipelines.Hosting" Version="4.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MyTrout.Pipelines.Hosting" Version="4.1.0" />
<PackageReference Include="MyTrout.Pipelines.Hosting" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MyTrout.Pipelines.Hosting --version 4.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MyTrout.Pipelines.Hosting, 4.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MyTrout.Pipelines.Hosting@4.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MyTrout.Pipelines.Hosting&version=4.1.0
#tool nuget:?package=MyTrout.Pipelines.Hosting&version=4.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MyTrout.Pipelines.Hosting
Introduction
MyTrout.Pipelines.Hosting provides helper classes to run a pipeline using Microsoft's Generic Host.
MyTrout.Pipelines targets .NET 6.0
For more details on Pipelines, see Pipelines.Core
For more details on Pipelines.Steps, see Pipelines.Steps.Core
Installing via NuGet
Install-Package MyTrout.Pipelines.Hosting
Software dependencies
1. Microsoft.Hosting 6.0.0
2. Microsoft.Hosting.Abstractions 6.0.0
3. MyTrout.Pipelines 3.2.x
All software dependencies listed above use the MIT License.
How do I use Pipelines.Hosting?
using MyTrout.Pipelines;
using MyTrout.Pipelines.Hosting;
using System;
using System.Linq;
using System.Threading.Tasks;
namespace MyTrout.Pipeline.Hosting.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
var host = Host.CreateDefaultBuilder(args)
.UsePipeline(builder =>
{
builder.AddStep<Step1>()
.AddStep<Step2>()
.AddStep<Step3>();
})
.Build();
//
// IMPORTANT NOTE FOR DEVELOPERS:
//
// Use StartAsync() to allow the caller to review the PipelineContext after execution.
//
await host.StartAsync().ConfigureAwait(false);
var context = host.Services.GetService<PipelineContext>();
if(context.Errors.Any())
{
// TODO: Errors have already been logged, do any special error processing here.
}
await host.StopAsync().ConfigureAwait(false);
return 0;
}
}
}
}
How do I use Pipelines.Hosting with different configurations for different instances of the same step.
If Step1 prints the Step1Options value with a trailing space to the Console when each step is called, then the following code will generate "Moe, Larry & Curly ".
using MyTrout.Pipelines.Core;
using System;
using System.Linq;
using System.Threading.Tasks;
namespace MyTrout.Pipeline.Hosting.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
// IMPORTANT NOTE FOR DEVELOPERS !
//
// Step Dependencies with context must be defined BEFORE UsePipelines() to load the dependencies correctly.
//
var host = Host.CreateDefaultBuilder(args)
.UsePipeline(builder =>
{
builder.AddStep(new StepWithInstance<TestingStep1, Step1Options>("context-1", new Step1Options("Moe,"))
.AddStep(new StepWithInstance<TestingStep1, Step1Options>("context-2", new Step1Options("Larry")))
.AddStep(new StepWithInstance<TestingStep1, Step1Options>("context-3", new Step1Options("&"))
.AddStep(new StepWithInstance<TestingStep1, Step1Options>("context-4", new Step1Options("Curly"))
})
.Build();
// IMPORTANT NOTE FOR DEVELOPERS !
//
// Use StartAsync() to allow the caller to review the PipelineContext after execution.
//
await host.StartAsync().ConfigureAwait(false);
var context = host.Services.GetService<PipelineContext>();
if(context.Errors.Any())
{
// TODO: Errors have already been logged, do any special error processing here.
}
await host.StopAsync().ConfigureAwait(false);
return 0;
}
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.Extensions.Hosting (>= 6.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 6.0.0)
- MyTrout.Pipelines (>= 4.0.3 && < 5.0.0)
-
net7.0
- Microsoft.Extensions.Hosting (>= 6.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 6.0.0)
- MyTrout.Pipelines (>= 4.0.3 && < 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
4.1.0 | 647 | 12/6/2022 |
4.0.0 | 678 | 5/5/2022 |
3.1.0 | 424 | 12/26/2021 |
3.0.0 | 513 | 6/26/2021 |
2.0.2 | 600 | 12/16/2020 |
1.2.0 | 698 | 8/9/2020 |
1.0.0 | 589 | 7/23/2020 |
0.21.0-beta | 479 | 7/17/2020 |
0.20.0-beta | 438 | 6/26/2020 |
0.19.0-beta | 498 | 6/25/2020 |
0.15.1-beta | 468 | 4/25/2020 |