Skip to content

Commit b9a727e

Browse files
Alex-KumGermanCoding
authored andcommitted
fix publisher di
1 parent 3d31332 commit b9a727e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Motor.Extensions.Hosting.Publisher/PublisherBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void AddPublisher<TPublisher>()
4343
public void AddPublisher<TPublisher>(Func<IServiceProvider, TPublisher> implementationFactory)
4444
where TPublisher : class, IRawMessagePublisher<TOutput>
4545
{
46-
_serviceCollection.AddTransient(typeof(IRawMessagePublisher<TOutput>), typeof(TPublisher));
46+
_serviceCollection.AddTransient<IRawMessagePublisher<TOutput>>(sp => implementationFactory(sp));
4747
_serviceCollection.AddTransient(implementationFactory);
4848
_serviceCollection.AddTransient<IMessageEncoder, NoOpMessageEncoder>();
4949
PublisherImplType = typeof(TypedMessagePublisher<TOutput, TPublisher>);

0 commit comments

Comments
 (0)