Skip to content

Commit

Permalink
Can use aggregate loaded from [Aggregate] in middleware. Closes GH-628
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Nov 13, 2023
1 parent ca0ea5a commit 21ced43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Persistence/Wolverine.Marten/AggregateHandlerAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ internal static void DetermineEventCaptureHandling(IChain chain, MethodCall firs

internal static Variable RelayAggregateToHandlerMethod(MethodCall loader, MethodCall firstCall, Type aggregateType)
{
var aggregateVariable = new Variable(aggregateType!,
$"{loader.ReturnVariable!.Usage}.{nameof(IEventStream<string>.Aggregate)}");
var aggregateVariable = new MemberAccessVariable(loader.ReturnVariable,
typeof(IEventStream<>).MakeGenericType(aggregateType).GetProperty("Aggregate"));

if (firstCall.HandlerType == aggregateType)
{
Expand Down

0 comments on commit 21ced43

Please sign in to comment.