Skip to content

Commit 4ef4358

Browse files
committed
fix: On the OrleansAggregateHandlerFactory use reflection on the interface implementation to reroute via the generic implementation.
1 parent 1fbfb72 commit 4ef4358

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Whaally.Domain.Infrastructure.OrleansHost/OrleansAggregateProviderFactory.cs src/Whaally.Domain.Infrastructure.OrleansHost/OrleansAggregateHandlerFactory.cs

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ public OrleansAggregateHandlerFactory(
1212
_clusterClient = clusterClient;
1313
}
1414

15+
IAggregateHandler IAggregateHandlerFactory.Instantiate(Type aggregateType, string id)
16+
=> (GetType()
17+
.GetMethod(nameof(IAggregateHandlerFactory.Instantiate))!
18+
.MakeGenericMethod(aggregateType)
19+
.Invoke(this, [id]) as IAggregateHandler)!;
1520

1621
IAggregateHandler<TAggregate> IAggregateHandlerFactory.Instantiate<TAggregate>(string id)
1722
=> _clusterClient.GetGrain<IAggregateHandlerGrain<TAggregate>>(Guid.Parse(id));

0 commit comments

Comments
 (0)