diff --git a/README.md b/README.md index a487d69..ffad393 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ dotnet add package PipelineNet - [Middleware](#middleware) - [Pipelines](#pipelines) - [Chains of responsibility](#chains-of-responsibility) -- [Factories](#factories) +- [Middleware flow factories](#middleware-flow-factories) - [Middleware resolver](#middleware-resolver) - [ServiceProvider implementation](#serviceprovider-implementation) - [Unity implementation](#unity-implementation) @@ -197,7 +197,7 @@ result = await exceptionHandlersChain.Execute(new ArgumentException()); // Resul result = await exceptionHandlersChain.Execute(new InvalidOperationException()); // Result will be false ``` -## Factories +## Middleware flow factories Instead of instantiating pipelines and chains of responsibility directly, you can use factories to instantiate them: ```C# IAsyncPipelineFactory pipelineFactory = new AsyncPipelineFactory(new ActivatorMiddlewareResovler()); @@ -232,8 +232,16 @@ You can grab it from nuget with: Install-Package PipelineNet.ServiceProvider ``` -Use it as follows: +Use it with `ServiceCollectionExtensions`: ```C# +// The following line adds: +// - all middleware from assembly +// - service provider middleware resolver +// - open generic middleware flow factories +// with default scoped lifetime +services.AddPipelineNet(typeof(RoudCornersAsyncMiddleware).Assembly); +services.AddScoped(); + public interface IMyService { Task DoSomething(); @@ -243,12 +251,12 @@ public class MyService : IMyService { private readonly IAsyncPipelineFactory _pipelineFactory; - public MyPipelineFactory(IAsyncPipelineFactory pipelineFactory) + public MyService(IAsyncPipelineFactory pipelineFactory) { _pipelineFactory = pipelineFactory; } - public Task DoSomething() + public async Task DoSomething() { IAsyncPipeline pipeline = _pipelineFactory.Create() .Add() @@ -265,7 +273,6 @@ public class RoudCornersAsyncMiddleware : IAsyncMiddleware { private readonly ILogger _logger; - // The following constructor arguments will be provided by IServiceProvider public RoudCornersAsyncMiddleware(ILogger logger) { _logger = logger; @@ -280,60 +287,28 @@ public class RoudCornersAsyncMiddleware : IAsyncMiddleware } ``` -Register it using `IHttpContextAccessor` (recommended): +Alternatively, you can instantiate `ServiceProviderMiddlewareResolver` directly: ```C# -services.AddSingleton(); - -services.AddMiddlewareFromAssembly(typeof(RoudCornersAsyncMiddleware).Assembly, ServiceLifetime.Scoped); // Add all middleware from assembly - -services.AddHttpContextAccessor(); - -services.TryAddSingleton(); // Add middleware resolver - -services.TryAddSingleton(typeof(IPipelineFactory<>), typeof(AsyncPipelineFactory<>)); // Add pipeline and chain of responsibility factories -services.TryAddSingleton(typeof(IAsyncPipelineFactory<>), typeof(AsyncPipelineFactory<>)); -services.TryAddSingleton(typeof(IResponsibilityChainFactory<,>), typeof(ResponsibilityChainFactory<,>)); -services.TryAddSingleton(typeof(IAsyncResponsibilityChainFactory<,>), typeof(AsyncResponsibilityChainFactory<,>)); +services.AddMiddlewareFromAssembly(typeof(RoudCornersAsyncMiddleware).Assembly); -public class HttpContextAccessorMiddlewareResolver : IMiddlewareResolver +public class MyService : IMyService { - private readonly IHttpContextAccessor _httpContextAccessor; - - public HttpContextAccessorMiddlewareResolver(IHttpContextAccessor httpContextAccessor) + public async Task DoSomething() { - _httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException("httpContextAccessor", - "An instance of IHttpContextAccessor must be provided."); - } + IServiceProvider serviceProvider = GetServiceProvider(); - public MiddlewareResolverResult Resolve(Type type) - { - var httpContext = _httpContextAccessor.HttpContext; - if (httpContext == null) throw new InvalidOperationException("HttpContext must not be null."); + IAsyncPipeline pipeline = new AsyncPipeline(new ServiceProviderMiddlewareResolver(serviceProvider)) + .Add() + .Add() + .Add(); - var middleware = httpContext.RequestServices.GetRequiredService(type); - bool isDisposable = false; + Bitmap image = (Bitmap) Image.FromFile("party-photo.png"); - return new MiddlewareResolverResult - { - Middleware = middleware, - IsDisposable = isDisposable - }; + await pipeline.Execute(image); } -} -``` -or `IServiceProvider`: -```C# -services.AddScoped(); - -services.AddMiddlewareFromAssembly(typeof(RoudCornersAsyncMiddleware).Assembly, ServiceLifetime.Scoped); // Add all middleware from assembly - -services.TryAddScoped(); // Add scoped middleware resolver so that scoped IServiceProvider is injected - -services.TryAddScoped(typeof(IPipelineFactory<>), typeof(AsyncPipelineFactory<>)); // Add pipeline and chain of responsibility factories -services.TryAddScoped(typeof(IAsyncPipelineFactory<>), typeof(AsyncPipelineFactory<>)); -services.TryAddScoped(typeof(IResponsibilityChainFactory<,>), typeof(ResponsibilityChainFactory<,>)); -services.TryAddScoped(typeof(IAsyncResponsibilityChainFactory<,>), typeof(AsyncResponsibilityChainFactory<,>)); + private IServiceProvider GetServiceProvider() => // Get service provider somehow +} ``` Note that `IServiceProvider` lifetime can vary based on the lifetime of the containing class. For example, if you resolve service from a scope, and it takes an `IServiceProvider`, it'll be a scoped instance. diff --git a/src/PipelineNet.ServiceProvider.Tests/PipelineNet.ServiceProvider.Tests.csproj b/src/PipelineNet.ServiceProvider.Tests/PipelineNet.ServiceProvider.Tests.csproj index fddb4dc..20bef78 100644 --- a/src/PipelineNet.ServiceProvider.Tests/PipelineNet.ServiceProvider.Tests.csproj +++ b/src/PipelineNet.ServiceProvider.Tests/PipelineNet.ServiceProvider.Tests.csproj @@ -12,6 +12,7 @@ + diff --git a/src/PipelineNet.ServiceProvider.Tests/ServiceCollectionExtensionsTests.cs b/src/PipelineNet.ServiceProvider.Tests/ServiceCollectionExtensionsTests.cs new file mode 100644 index 0000000..f6ef083 --- /dev/null +++ b/src/PipelineNet.ServiceProvider.Tests/ServiceCollectionExtensionsTests.cs @@ -0,0 +1,170 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using PipelineNet.Middleware; +using PipelineNet.PipelineFactories; +using PipelineNet.Pipelines; +using Xunit.Abstractions; + +namespace PipelineNet.ServiceProvider.Tests +{ + public class ServiceCollectionExtensionsTests + { + #region Parameter definitions + public class Image + { + public static Image FromFile(string filename) => new Bitmap(); + } + + public class Bitmap : Image + { + } + #endregion + + #region Service definitions + public interface IMyService + { + Task DoSomething(); + } + + public class MyService : IMyService + { + private readonly IAsyncPipelineFactory _pipelineFactory; + + public MyService(IAsyncPipelineFactory pipelineFactory) + { + _pipelineFactory = pipelineFactory; + } + + public async Task DoSomething() + { + IAsyncPipeline pipeline = _pipelineFactory.Create() + .Add() + .Add() + .Add(); + + Bitmap image = (Bitmap) Image.FromFile("party-photo.png"); + + await pipeline.Execute(image); + } + } + #endregion + + #region Middleware definitions + public class RoudCornersAsyncMiddleware : IAsyncMiddleware + { + private readonly ILogger _logger; + + public RoudCornersAsyncMiddleware(ILogger logger) + { + _logger = logger; + } + + public async Task Run(Bitmap parameter, Func next) + { + _logger.LogInformation("Running RoudCornersAsyncMiddleware."); + // Handle somehow + await next(parameter); + } + } + + public class AddTransparencyAsyncMiddleware : IAsyncMiddleware + { + private readonly ILogger _logger; + + public AddTransparencyAsyncMiddleware(ILogger logger) + { + _logger = logger; + } + + public async Task Run(Bitmap parameter, Func next) + { + _logger.LogInformation("Running AddTransparencyAsyncMiddleware."); + // Handle somehow + await next(parameter); + } + } + + public class AddWatermarkAsyncMiddleware : IAsyncMiddleware + { + private readonly ILogger _logger; + + public AddWatermarkAsyncMiddleware(ILogger logger) + { + _logger = logger; + } + + public async Task Run(Bitmap parameter, Func next) + { + _logger.LogInformation("Running AddWatermarkAsyncMiddleware."); + // Handle somehow + await next(parameter); + } + } + #endregion + + #region Logger definitions + public class TestOutputHelperLoggerProvider : ILoggerProvider + { + private readonly ITestOutputHelper _output; + + public TestOutputHelperLoggerProvider(ITestOutputHelper output) + { + _output = output; + } + + public ILogger CreateLogger(string categoryName) => + new TestOutputHelperLogger(_output); + + public void Dispose() + { + } + } + + public class TestOutputHelperLogger : ILogger + { + private readonly ITestOutputHelper _output; + + public TestOutputHelperLogger(ITestOutputHelper output) + { + _output = output; + } + + public IDisposable? BeginScope(TState state) where TState : notnull => + new NullScope(); + + public bool IsEnabled(LogLevel logLevel) => true; + + public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) => + _output.WriteLine($"{eventId}:{logLevel}:{formatter(state, exception)}"); + + private class NullScope : IDisposable + { + public void Dispose() + { + } + } + } + #endregion + + private readonly ITestOutputHelper _output; + + public ServiceCollectionExtensionsTests(ITestOutputHelper output) + { + _output = output; + } + + [Fact] + public async Task AddPipelineNet_Works_Readme() + { + var serviceProvider = new ServiceCollection() + .AddPipelineNet(typeof(RoudCornersAsyncMiddleware).Assembly) + .AddScoped() + .AddLogging(bulider => bulider.Services.AddSingleton(new TestOutputHelperLoggerProvider(_output))) + .BuildServiceProvider(); + var scope = serviceProvider.CreateScope(); + var service = scope.ServiceProvider.GetRequiredService(); + + await service.DoSomething(); + } + } +} diff --git a/src/PipelineNet.ServiceProvider/MiddlewareResolver/ActivatorUtilitiesMiddlewareResolver.cs b/src/PipelineNet.ServiceProvider/MiddlewareResolver/ActivatorUtilitiesMiddlewareResolver.cs index 71aac02..183c05d 100644 --- a/src/PipelineNet.ServiceProvider/MiddlewareResolver/ActivatorUtilitiesMiddlewareResolver.cs +++ b/src/PipelineNet.ServiceProvider/MiddlewareResolver/ActivatorUtilitiesMiddlewareResolver.cs @@ -6,7 +6,7 @@ namespace PipelineNet.ServiceProvider.MiddlewareResolver { /// /// An implementation of that creates - /// instances using the . + /// instances using the . /// public class ActivatorUtilitiesMiddlewareResolver : IMiddlewareResolver { diff --git a/src/PipelineNet.ServiceProvider/ServiceCollectionExtensions.cs b/src/PipelineNet.ServiceProvider/ServiceCollectionExtensions.cs index 2bf6a66..d2c48d5 100644 --- a/src/PipelineNet.ServiceProvider/ServiceCollectionExtensions.cs +++ b/src/PipelineNet.ServiceProvider/ServiceCollectionExtensions.cs @@ -1,6 +1,10 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; +using PipelineNet.ChainOfResponsibilityFactories; using PipelineNet.Middleware; +using PipelineNet.MiddlewareResolver; +using PipelineNet.PipelineFactories; +using PipelineNet.ServiceProvider.MiddlewareResolver; using System; using System.Collections.Generic; using System.Linq; @@ -13,6 +17,48 @@ namespace PipelineNet.ServiceProvider /// public static class ServiceCollectionExtensions { + /// + /// Adds all middleware from assemblies. Adds core PipelineNet services. + /// + /// The service collection. + /// Assemblies to scan. + /// The lifetime of the registered middleware and services. + /// The service collection. + public static IServiceCollection AddPipelineNet( + this IServiceCollection services, + IEnumerable assemblies, + ServiceLifetime lifetime = ServiceLifetime.Scoped) + { + if (services == null) throw new ArgumentNullException("services"); + if (assemblies == null) throw new ArgumentNullException("assemblies"); + + services.AddMiddlewareFromAssemblies(assemblies, lifetime); + services.AddPipelineNetCore(lifetime); + + return services; + } + + /// + /// Adds all middleware from the assembly. Adds core PipelineNet services. + /// + /// The service collection. + /// The assembly to scan. + /// The lifetime of the registered middleware and services. + /// The service collection. + public static IServiceCollection AddPipelineNet( + this IServiceCollection services, + Assembly assembly, + ServiceLifetime lifetime = ServiceLifetime.Scoped) + { + if (services == null) throw new ArgumentNullException("services"); + if (assembly == null) throw new ArgumentNullException("assembly"); + + services.AddMiddlewareFromAssembly(assembly, lifetime); + services.AddPipelineNetCore(lifetime); + + return services; + } + /// /// Adds all middleware from assemblies. /// @@ -73,5 +119,27 @@ public static IServiceCollection AddMiddlewareFromAssembly( return services; } + + /// + /// Adds core PipelineNet services. + /// + /// The service collection. + /// The lifetime of the registered services. + /// The service collection. + public static IServiceCollection AddPipelineNetCore( + this IServiceCollection services, + ServiceLifetime lifetime = ServiceLifetime.Scoped) + { + if (services == null) throw new ArgumentNullException("services"); + + services.TryAdd(new ServiceDescriptor(typeof(IMiddlewareResolver), typeof(ServiceProviderMiddlewareResolver), lifetime)); + + services.TryAdd(new ServiceDescriptor(typeof(IPipelineFactory<>), typeof(AsyncPipelineFactory<>), lifetime)); + services.TryAdd(new ServiceDescriptor(typeof(IAsyncPipelineFactory<>), typeof(AsyncPipelineFactory<>), lifetime)); + services.TryAdd(new ServiceDescriptor(typeof(IResponsibilityChainFactory<,>), typeof(ResponsibilityChainFactory<,>), lifetime)); + services.TryAdd(new ServiceDescriptor(typeof(IAsyncResponsibilityChainFactory<,>), typeof(AsyncResponsibilityChainFactory<,>), lifetime)); + + return services; + } } } diff --git a/src/PipelineNet.Tests/ChainsOfResponsibility/AsyncResponsibilityChainTests.cs b/src/PipelineNet.Tests/ChainsOfResponsibility/AsyncResponsibilityChainTests.cs index f864907..2dcb5b2 100644 --- a/src/PipelineNet.Tests/ChainsOfResponsibility/AsyncResponsibilityChainTests.cs +++ b/src/PipelineNet.Tests/ChainsOfResponsibility/AsyncResponsibilityChainTests.cs @@ -1,6 +1,8 @@ using PipelineNet.ChainsOfResponsibility; using PipelineNet.Middleware; using PipelineNet.MiddlewareResolver; +using System; +using System.Threading.Tasks; using Xunit; namespace PipelineNet.Tests.ChainsOfResponsibility diff --git a/src/PipelineNet.Tests/ChainsOfResponsibility/ResponsibilityChainTests.cs b/src/PipelineNet.Tests/ChainsOfResponsibility/ResponsibilityChainTests.cs index e461958..65d0767 100644 --- a/src/PipelineNet.Tests/ChainsOfResponsibility/ResponsibilityChainTests.cs +++ b/src/PipelineNet.Tests/ChainsOfResponsibility/ResponsibilityChainTests.cs @@ -1,6 +1,7 @@ using PipelineNet.ChainsOfResponsibility; using PipelineNet.Middleware; using PipelineNet.MiddlewareResolver; +using System; using Xunit; namespace PipelineNet.Tests.ChainsOfResponsibility diff --git a/src/PipelineNet.Tests/Pipelines/AsyncPipelineTests.cs b/src/PipelineNet.Tests/Pipelines/AsyncPipelineTests.cs index 69d9be4..804681f 100644 --- a/src/PipelineNet.Tests/Pipelines/AsyncPipelineTests.cs +++ b/src/PipelineNet.Tests/Pipelines/AsyncPipelineTests.cs @@ -1,7 +1,10 @@ using PipelineNet.Middleware; using PipelineNet.MiddlewareResolver; using PipelineNet.Pipelines; +using System; using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; using Xunit; namespace PipelineNet.Tests.Pipelines diff --git a/src/PipelineNet.Tests/Pipelines/PipelineTests.cs b/src/PipelineNet.Tests/Pipelines/PipelineTests.cs index a63e205..2a05850 100644 --- a/src/PipelineNet.Tests/Pipelines/PipelineTests.cs +++ b/src/PipelineNet.Tests/Pipelines/PipelineTests.cs @@ -1,6 +1,7 @@ using PipelineNet.Middleware; using PipelineNet.MiddlewareResolver; using PipelineNet.Pipelines; +using System; using System.Text.RegularExpressions; using Xunit; diff --git a/src/PipelineNet/ChainsOfResponsibility/Factories/AsyncResponsibilityChainFactory.cs b/src/PipelineNet/ChainOfResponsibilityFactories/AsyncResponsibilityChainFactory.cs similarity index 93% rename from src/PipelineNet/ChainsOfResponsibility/Factories/AsyncResponsibilityChainFactory.cs rename to src/PipelineNet/ChainOfResponsibilityFactories/AsyncResponsibilityChainFactory.cs index 3138a0b..6c348cb 100644 --- a/src/PipelineNet/ChainsOfResponsibility/Factories/AsyncResponsibilityChainFactory.cs +++ b/src/PipelineNet/ChainOfResponsibilityFactories/AsyncResponsibilityChainFactory.cs @@ -2,7 +2,7 @@ using PipelineNet.MiddlewareResolver; using System; -namespace PipelineNet.ServiceProvider.ChainsOfResponsibility.Factories +namespace PipelineNet.ChainOfResponsibilityFactories { /// public class AsyncResponsibilityChainFactory diff --git a/src/PipelineNet/ChainsOfResponsibility/Factories/IAsyncResponsibilityChainFactory.cs b/src/PipelineNet/ChainOfResponsibilityFactories/IAsyncResponsibilityChainFactory.cs similarity index 90% rename from src/PipelineNet/ChainsOfResponsibility/Factories/IAsyncResponsibilityChainFactory.cs rename to src/PipelineNet/ChainOfResponsibilityFactories/IAsyncResponsibilityChainFactory.cs index c1889d4..9d0872c 100644 --- a/src/PipelineNet/ChainsOfResponsibility/Factories/IAsyncResponsibilityChainFactory.cs +++ b/src/PipelineNet/ChainOfResponsibilityFactories/IAsyncResponsibilityChainFactory.cs @@ -1,6 +1,6 @@ using PipelineNet.ChainsOfResponsibility; -namespace PipelineNet.ServiceProvider.ChainsOfResponsibility.Factories +namespace PipelineNet.ChainOfResponsibilityFactories { /// /// Used to create new instances of asynchronous chain of responsibility. diff --git a/src/PipelineNet/ChainsOfResponsibility/Factories/IResponsibilityChainFactory.cs b/src/PipelineNet/ChainOfResponsibilityFactories/IResponsibilityChainFactory.cs similarity index 89% rename from src/PipelineNet/ChainsOfResponsibility/Factories/IResponsibilityChainFactory.cs rename to src/PipelineNet/ChainOfResponsibilityFactories/IResponsibilityChainFactory.cs index 90d6dc5..4130a28 100644 --- a/src/PipelineNet/ChainsOfResponsibility/Factories/IResponsibilityChainFactory.cs +++ b/src/PipelineNet/ChainOfResponsibilityFactories/IResponsibilityChainFactory.cs @@ -1,6 +1,6 @@ using PipelineNet.ChainsOfResponsibility; -namespace PipelineNet.ServiceProvider.ChainsOfResponsibility.Factories +namespace PipelineNet.ChainOfResponsibilityFactories { /// /// Used to create new instances of chain of responsibility. diff --git a/src/PipelineNet/ChainsOfResponsibility/Factories/ResponsibilityChainFactory.cs b/src/PipelineNet/ChainOfResponsibilityFactories/ResponsibilityChainFactory.cs similarity index 93% rename from src/PipelineNet/ChainsOfResponsibility/Factories/ResponsibilityChainFactory.cs rename to src/PipelineNet/ChainOfResponsibilityFactories/ResponsibilityChainFactory.cs index b1978e7..176d307 100644 --- a/src/PipelineNet/ChainsOfResponsibility/Factories/ResponsibilityChainFactory.cs +++ b/src/PipelineNet/ChainOfResponsibilityFactories/ResponsibilityChainFactory.cs @@ -2,7 +2,7 @@ using PipelineNet.MiddlewareResolver; using System; -namespace PipelineNet.ServiceProvider.ChainsOfResponsibility.Factories +namespace PipelineNet.ChainOfResponsibilityFactories { /// public class ResponsibilityChainFactory diff --git a/src/PipelineNet/ChainsOfResponsibility/AsyncResponsibilityChain.cs b/src/PipelineNet/ChainsOfResponsibility/AsyncResponsibilityChain.cs index a951e78..3cd1d9c 100644 --- a/src/PipelineNet/ChainsOfResponsibility/AsyncResponsibilityChain.cs +++ b/src/PipelineNet/ChainsOfResponsibility/AsyncResponsibilityChain.cs @@ -120,7 +120,7 @@ public async Task Execute(TParameter parameter) /// /// Sets the function to be executed at the end of the chain as a fallback. - /// A chain can only have one finally function. Calling this method + /// A chain can only have one finally function. Calling this method more /// a second time will just replace the existing finally . /// /// The function that will be execute at the end of chain. diff --git a/src/PipelineNet/ChainsOfResponsibility/IAsyncResponsibilityChain.cs b/src/PipelineNet/ChainsOfResponsibility/IAsyncResponsibilityChain.cs index c8fde0b..44ec02f 100644 --- a/src/PipelineNet/ChainsOfResponsibility/IAsyncResponsibilityChain.cs +++ b/src/PipelineNet/ChainsOfResponsibility/IAsyncResponsibilityChain.cs @@ -13,7 +13,7 @@ public interface IAsyncResponsibilityChain { /// /// Sets the function to be executed at the end of the chain as a fallback. - /// A chain can only have one finally function. Calling this method + /// A chain can only have one finally function. Calling this method more /// a second time will just replace the existing finally . /// /// The function that will be execute at the end of chain. diff --git a/src/PipelineNet/ChainsOfResponsibility/IResponsibilityChain.cs b/src/PipelineNet/ChainsOfResponsibility/IResponsibilityChain.cs index a42ea71..7cf5af2 100644 --- a/src/PipelineNet/ChainsOfResponsibility/IResponsibilityChain.cs +++ b/src/PipelineNet/ChainsOfResponsibility/IResponsibilityChain.cs @@ -12,7 +12,7 @@ public interface IResponsibilityChain { /// /// Sets the function to be executed at the end of the chain as a fallback. - /// A chain can only have one finally function. Calling this method + /// A chain can only have one finally function. Calling this method more /// a second time will just replace the existing finally . /// /// The that will be execute at the end of chain. diff --git a/src/PipelineNet/ChainsOfResponsibility/ResponsibilityChain.cs b/src/PipelineNet/ChainsOfResponsibility/ResponsibilityChain.cs index ab19289..9ad61d4 100644 --- a/src/PipelineNet/ChainsOfResponsibility/ResponsibilityChain.cs +++ b/src/PipelineNet/ChainsOfResponsibility/ResponsibilityChain.cs @@ -24,7 +24,7 @@ public ResponsibilityChain(IMiddlewareResolver middlewareResolver) : base(middle /// /// Sets the function to be executed at the end of the chain as a fallback. - /// A chain can only have one finally function. Calling this method + /// A chain can only have one finally function. Calling this method more /// a second time will just replace the existing finally . /// /// The that will be execute at the end of chain. diff --git a/src/PipelineNet/MiddlewareResolver/ActivatorMiddlewareResolver.cs b/src/PipelineNet/MiddlewareResolver/ActivatorMiddlewareResolver.cs index 1dd5deb..f9345dd 100644 --- a/src/PipelineNet/MiddlewareResolver/ActivatorMiddlewareResolver.cs +++ b/src/PipelineNet/MiddlewareResolver/ActivatorMiddlewareResolver.cs @@ -4,7 +4,7 @@ namespace PipelineNet.MiddlewareResolver { /// /// A default implementation of that creates - /// instances using the . + /// instances using the . /// public class ActivatorMiddlewareResolver : IMiddlewareResolver { diff --git a/src/PipelineNet/MiddlewareResolver/MiddlewareResolverResult.cs b/src/PipelineNet/MiddlewareResolver/MiddlewareResolverResult.cs index 0e2064c..85b42f2 100644 --- a/src/PipelineNet/MiddlewareResolver/MiddlewareResolverResult.cs +++ b/src/PipelineNet/MiddlewareResolver/MiddlewareResolverResult.cs @@ -14,7 +14,7 @@ public class MiddlewareResolverResult /// Gets or sets the value indicating whether the middleware should be disposed. /// Set this to if the middleware is IDisposable or /// IAsyncDisposable (requires .NET Standard 2.1 or greater) - /// and was not created by a dependency injection container. + /// and is not disposed by a dependency injection container. /// public bool IsDisposable { get; set; } } diff --git a/src/PipelineNet/Pipelines/Factories/AsyncPipelineFactory.cs b/src/PipelineNet/PipelineFactories/AsyncPipelineFactory.cs similarity index 94% rename from src/PipelineNet/Pipelines/Factories/AsyncPipelineFactory.cs rename to src/PipelineNet/PipelineFactories/AsyncPipelineFactory.cs index 04f2b52..087f698 100644 --- a/src/PipelineNet/Pipelines/Factories/AsyncPipelineFactory.cs +++ b/src/PipelineNet/PipelineFactories/AsyncPipelineFactory.cs @@ -2,7 +2,7 @@ using PipelineNet.Pipelines; using System; -namespace PipelineNet.ServiceProvider.Pipelines.Factories +namespace PipelineNet.PipelineFactories { /// public class AsyncPipelineFactory diff --git a/src/PipelineNet/Pipelines/Factories/IAsyncPipelineFactory.cs b/src/PipelineNet/PipelineFactories/IAsyncPipelineFactory.cs similarity index 89% rename from src/PipelineNet/Pipelines/Factories/IAsyncPipelineFactory.cs rename to src/PipelineNet/PipelineFactories/IAsyncPipelineFactory.cs index b8553b8..60806c6 100644 --- a/src/PipelineNet/Pipelines/Factories/IAsyncPipelineFactory.cs +++ b/src/PipelineNet/PipelineFactories/IAsyncPipelineFactory.cs @@ -1,6 +1,6 @@ using PipelineNet.Pipelines; -namespace PipelineNet.ServiceProvider.Pipelines.Factories +namespace PipelineNet.PipelineFactories { /// /// Used to create new instances of asynchronous pipeline. diff --git a/src/PipelineNet/Pipelines/Factories/IPipelineFactory.cs b/src/PipelineNet/PipelineFactories/IPipelineFactory.cs similarity index 89% rename from src/PipelineNet/Pipelines/Factories/IPipelineFactory.cs rename to src/PipelineNet/PipelineFactories/IPipelineFactory.cs index bbf5910..0e78119 100644 --- a/src/PipelineNet/Pipelines/Factories/IPipelineFactory.cs +++ b/src/PipelineNet/PipelineFactories/IPipelineFactory.cs @@ -1,6 +1,6 @@ using PipelineNet.Pipelines; -namespace PipelineNet.ServiceProvider.Pipelines.Factories +namespace PipelineNet.PipelineFactories { /// /// Used to create new instances of pipeline. diff --git a/src/PipelineNet/Pipelines/Factories/PipelineFactory.cs b/src/PipelineNet/PipelineFactories/PipelineFactory.cs similarity index 93% rename from src/PipelineNet/Pipelines/Factories/PipelineFactory.cs rename to src/PipelineNet/PipelineFactories/PipelineFactory.cs index b07c51c..c4df6ec 100644 --- a/src/PipelineNet/Pipelines/Factories/PipelineFactory.cs +++ b/src/PipelineNet/PipelineFactories/PipelineFactory.cs @@ -2,7 +2,7 @@ using PipelineNet.Pipelines; using System; -namespace PipelineNet.ServiceProvider.Pipelines.Factories +namespace PipelineNet.PipelineFactories { /// public class PipelineFactory