File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/JsonApiDotNetCore/Builders Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -62,16 +62,16 @@ public Documents Build(IEnumerable<IIdentifiable> entities)
6262 private Dictionary < string , object > _getMeta ( IIdentifiable entity )
6363 {
6464 if ( entity == null ) return null ;
65-
66- var meta = new Dictionary < string , object > ( ) ;
67- var metaEntity = entity as IHasMeta ;
6865
69- if ( metaEntity != null )
70- meta = metaEntity . GetMeta ( _jsonApiContext ) ;
66+ var builder = _jsonApiContext . MetaBuilder ;
67+
68+ if ( entity is IHasMeta metaEntity )
69+ builder . Add ( metaEntity . GetMeta ( _jsonApiContext ) ) ;
7170
7271 if ( _jsonApiContext . Options . IncludeTotalRecordCount )
73- meta [ "total-records" ] = _jsonApiContext . PageManager . TotalRecords ;
72+ builder . Add ( "total-records" , _jsonApiContext . PageManager . TotalRecords ) ;
7473
74+ var meta = builder . Build ( ) ;
7575 if ( meta . Count > 0 ) return meta ;
7676 return null ;
7777 }
You can’t perform that action at this time.
0 commit comments