File tree 1 file changed +6
-7
lines changed
src/JsonApiDotNetCore/Builders
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -68,21 +68,20 @@ public Documents Build(IEnumerable<IIdentifiable> entities)
68
68
69
69
private Dictionary < string , object > GetMeta ( IIdentifiable entity )
70
70
{
71
- if ( entity == null ) return null ;
72
-
73
71
var builder = _jsonApiContext . MetaBuilder ;
74
-
75
- if ( entity is IHasMeta metaEntity )
76
- builder . Add ( metaEntity . GetMeta ( _jsonApiContext ) ) ;
77
-
78
72
if ( _jsonApiContext . Options . IncludeTotalRecordCount && _jsonApiContext . PageManager . TotalRecords != null )
79
73
builder . Add ( "total-records" , _jsonApiContext . PageManager . TotalRecords ) ;
80
74
81
75
if ( _requestMeta != null )
82
76
builder . Add ( _requestMeta . GetMeta ( ) ) ;
83
77
78
+ if ( entity != null && entity is IHasMeta metaEntity )
79
+ builder . Add ( metaEntity . GetMeta ( _jsonApiContext ) ) ;
80
+
84
81
var meta = builder . Build ( ) ;
85
- if ( meta . Count > 0 ) return meta ;
82
+ if ( meta . Count > 0 )
83
+ return meta ;
84
+
86
85
return null ;
87
86
}
88
87
You can’t perform that action at this time.
0 commit comments