Skip to content

Commit 7a6360c

Browse files
committed
docs, si container
1 parent 324622c commit 7a6360c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/Mediator/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ To register the mediator as well as your customer command/notification-handlers,
1414
container.RegisterMediator(services, [ typeof(Program).Assembly ]);
1515
```
1616

17+
Note that SimpleInjector does not come as transient build dependency and must be referenced in the project.
18+
1719
## Mediator transaction handling
1820

1921
By default all requests and notifications will run within a TransactionScope.

docs/UnitTests/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@ The unit test framwork tries to provide the following features & design goals:
3131

3232
## Setup
3333

34-
Currently SimpleInjector and Microsofts dependency injection are supported. Reference the required library accordingly:
35-
- `Fusonic.Extensions.UnitTests.SimpleInjector` or
36-
- `Fusonic.Extensions.UnitTests.ServiceProvider`
34+
Currently SimpleInjector and Microsofts dependency injection are supported.
3735

3836
Create a `TestBase` and a `TestFixture` for the assembly.
3937

40-
The `TestFixture` is used for registering your depdendencies. Override `ServiceProviderTestFixture` or `SimpleInjectorTestFixture`, depending on the DI container you want to use.
38+
The `TestFixture` is used for registering your depdendencies. Override `ServiceProviderTestFixture` or `SimpleInjectorTestFixture`, depending on the DI container you want to use. Note that when using SimpleInjector, you must reference it in your projects, as it does not come as a transient build dependency when using `Fusonic.Extensions.UnitTests`.
4139

4240
The `TestBase` is used for tying up the test base from the extensions and your test fixture.
4341

src/Mediator/src/ContainerExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public static void RegisterMediator(this Container container, IServiceCollection
2727
container.RegisterSingleton<ITransactionScopeHandler, TransactionScopeHandler>();
2828
}
2929

30-
container.Register<IMediator, SimpleInjectorMediator>(Lifestyle.Transient);
30+
container.RegisterSingleton<IMediator, SimpleInjectorMediator>();
3131
container.Register(typeof(IRequestHandler<,>), assemblies, Lifestyle.Scoped);
3232
container.Register(typeof(IAsyncEnumerableRequestHandler<,>), assemblies, Lifestyle.Scoped);
3333
container.Collection.Register(typeof(INotificationHandler<>), assemblies, Lifestyle.Scoped);
3434

3535
services.AddSingleton(_ => container.GetInstance<IMediator>());
3636
}
3737

38-
internal class SimpleInjectorMediator(Scope scope) : ServiceProviderMediator(scope);
38+
internal class SimpleInjectorMediator(Container container) : ServiceProviderMediator(container);
3939
}

0 commit comments

Comments
 (0)