Skip to content

Commit 7c30e4f

Browse files
author
Bart Koelman
authored
Enable assembly scanning, combined with replaced open generics upfront (#982)
1 parent 6540c12 commit 7c30e4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/JsonApiDotNetCore/Configuration/JsonApiApplicationBuilder.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using Microsoft.EntityFrameworkCore;
2525
using Microsoft.EntityFrameworkCore.Metadata;
2626
using Microsoft.Extensions.DependencyInjection;
27+
using Microsoft.Extensions.DependencyInjection.Extensions;
2728
using Microsoft.Extensions.Logging;
2829

2930
namespace JsonApiDotNetCore.Configuration
@@ -212,7 +213,7 @@ private void RegisterImplementationForOpenInterfaces(HashSet<Type> openGenericIn
212213
{
213214
Type implementationType = openGenericInterface.GetGenericArguments().Length == 1 ? intImplementation : implementation;
214215

215-
_services.AddScoped(openGenericInterface, implementationType);
216+
_services.TryAddScoped(openGenericInterface, implementationType);
216217
}
217218
}
218219

0 commit comments

Comments
 (0)