@@ -18,17 +18,17 @@ public static EventStoreOptionsBuilder UseCQRS(
18
18
19
19
configure ? . Invoke ( cqrsBuilder ) ;
20
20
21
- builder . Services . AddSingleton ( typeof ( IStateProjector < > ) , typeof ( StateProjector < > ) ) ;
22
- builder . Services . AddSingleton ( typeof ( IStateWriter < > ) , typeof ( StateWriter < > ) ) ;
23
- builder . Services . AddTransient ( typeof ( ICommandProcessor < > ) , typeof ( CommandProcessor < > ) ) ;
24
- builder . Services . AddTransient < ICommandProcessorFactory , CommandProcessorFactory > ( ) ;
25
- builder . Services . AddTransient < ICommandHandlerFactory , CommandHandlerFactory > ( ) ;
26
- builder . Services . AddSingleton < ICommandTelemetry , CommandTelemetry > ( ) ;
21
+ builder . Services . TryAddSingleton ( typeof ( IStateProjector < > ) , typeof ( StateProjector < > ) ) ;
22
+ builder . Services . TryAddSingleton ( typeof ( IStateWriter < > ) , typeof ( StateWriter < > ) ) ;
23
+ builder . Services . TryAddTransient ( typeof ( ICommandProcessor < > ) , typeof ( CommandProcessor < > ) ) ;
24
+ builder . Services . TryAddTransient < ICommandProcessorFactory , CommandProcessorFactory > ( ) ;
25
+ builder . Services . TryAddTransient < ICommandHandlerFactory , CommandHandlerFactory > ( ) ;
26
+ builder . Services . TryAddSingleton < ICommandTelemetry , CommandTelemetry > ( ) ;
27
27
28
- builder . Services . AddSingleton < IProjectionOptionsFactory , ProjectionOptionsFactory > ( ) ;
28
+ builder . Services . TryAddSingleton < IProjectionOptionsFactory , ProjectionOptionsFactory > ( ) ;
29
29
30
- builder . Services . AddSingleton ( typeof ( ProjectionMetadata < > ) , typeof ( ProjectionMetadata < > ) ) ;
31
- builder . Services . AddTransient < IProjectionFactory , DefaultProjectionFactory > ( ) ;
30
+ builder . Services . TryAddSingleton ( typeof ( ProjectionMetadata < > ) , typeof ( ProjectionMetadata < > ) ) ;
31
+ builder . Services . TryAddTransient < IProjectionFactory , DefaultProjectionFactory > ( ) ;
32
32
33
33
builder . Services . TryAddSingleton < IProjectionTelemetry , ProjectionTelemetry > ( ) ;
34
34
0 commit comments