Skip to content

Commit e5feec1

Browse files
dayportmadskristensen
authored andcommitted
Added TryAddSingleton to fix a bug when registering service with default values (#58)
1 parent c8cb11b commit e5feec1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/ServiceCollectionExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public static class ServiceCollectionExtensions
1717
/// </summary>
1818
public static IServiceCollection AddServiceWorker(this IServiceCollection services)
1919
{
20+
21+
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
2022
services.AddTransient<ITagHelperComponent, ServiceWorkerTagHelperComponent>();
2123
services.AddTransient(svc => new PwaOptions(svc.GetRequiredService<IConfiguration>()));
2224

0 commit comments

Comments
 (0)