7
7
using JsonApiDotNetCore . QueryStrings ;
8
8
using JsonApiDotNetCore . Repositories ;
9
9
using JsonApiDotNetCore . Resources ;
10
- using JsonApiDotNetCore . Serialization . JsonConverters ;
11
10
using JsonApiDotNetCore . Serialization . Request ;
12
11
using JsonApiDotNetCore . Serialization . Request . Adapters ;
13
12
using JsonApiDotNetCore . Serialization . Response ;
@@ -74,6 +73,8 @@ public void ConfigureResourceGraph(ICollection<Type> dbContextTypes, Action<Reso
74
73
_services . TryAddSingleton ( serviceProvider =>
75
74
{
76
75
var loggerFactory = serviceProvider . GetRequiredService < ILoggerFactory > ( ) ;
76
+ var events = serviceProvider . GetRequiredService < IJsonApiApplicationBuilderEvents > ( ) ;
77
+
77
78
var resourceGraphBuilder = new ResourceGraphBuilder ( _options , loggerFactory ) ;
78
79
79
80
var scanner = new ResourcesAssemblyScanner ( _assemblyCache , resourceGraphBuilder ) ;
@@ -93,8 +94,7 @@ public void ConfigureResourceGraph(ICollection<Type> dbContextTypes, Action<Reso
93
94
configureResourceGraph ? . Invoke ( resourceGraphBuilder ) ;
94
95
95
96
IResourceGraph resourceGraph = resourceGraphBuilder . Build ( ) ;
96
-
97
- _options . SerializerOptions . Converters . Add ( new ResourceObjectConverter ( resourceGraph ) ) ;
97
+ events . ResourceGraphBuilt ( resourceGraph ) ;
98
98
99
99
return resourceGraph ;
100
100
} ) ;
@@ -169,6 +169,7 @@ public void ConfigureServiceContainer(ICollection<Type> dbContextTypes)
169
169
_services . TryAddScoped < IQueryLayerComposer , QueryLayerComposer > ( ) ;
170
170
_services . TryAddScoped < IInverseNavigationResolver , InverseNavigationResolver > ( ) ;
171
171
_services . TryAddSingleton < IDocumentDescriptionLinkProvider , NoDocumentDescriptionLinkProvider > ( ) ;
172
+ _services . TryAddSingleton < IJsonApiApplicationBuilderEvents , DefaultJsonApiApplicationBuilderEvents > ( ) ;
172
173
}
173
174
174
175
private void AddMiddlewareLayer ( )
0 commit comments