Skip to content

Commit

Permalink
[Handlers] Add back a list of assemblies that have been scanned when …
Browse files Browse the repository at this point in the history
…calling IOperationExecutorBuilderScanner.FindHandlers
  • Loading branch information
barclayadam committed Apr 26, 2023
1 parent 14b91e9 commit 04cb13e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Blueprint/Configuration/ExecutorScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void RegisterHandler(ApiOperationDescriptor operation, IOperationExecutorBuilder

foreach (var scanner in this._scanners)
{
scanner.FindHandlers(new ScannerContext(operations, services, RegisterHandler));
scanner.FindHandlers(new ScannerContext(operations, services, operationScanner.ScannedAssemblies, RegisterHandler));
}

// ReSharper disable once ForeachCanBeConvertedToQueryUsingAnotherGetEnumerator Avoid LINQ allocations
Expand Down
3 changes: 3 additions & 0 deletions src/Blueprint/Middleware/IOperationExecutorBuilderScanner.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;

namespace Blueprint.Middleware;

/// <param name="Operations">The operations to scan for builders for.</param>
/// <param name="Services">The service collection that services can be registered for use at pipeline runtime.</param>
/// <param name="ScannedAssemblies">The assemblies that have been scanned to find operations.</param>
/// <param name="RegisterHandler">The action to call to register a handler.</param>
public record ScannerContext(
List<ApiOperationDescriptor> Operations,
IServiceCollection Services,
IReadOnlyList<Assembly> ScannedAssemblies,
Action<ApiOperationDescriptor, IOperationExecutorBuilder> RegisterHandler);

/// <summary>
Expand Down

0 comments on commit 04cb13e

Please sign in to comment.