@@ -58,7 +58,7 @@ public Documents Build(IEnumerable<IIdentifiable> entities)
5858 var enumeratedEntities = entities as IList < IIdentifiable > ?? entities . ToList ( ) ;
5959 var documents = new Documents
6060 {
61- Data = new List < DocumentData > ( ) ,
61+ Data = new List < ResourceObject > ( ) ,
6262 Meta = GetMeta ( enumeratedEntities . FirstOrDefault ( ) )
6363 } ;
6464
@@ -95,7 +95,7 @@ private Dictionary<string, object> GetMeta(IIdentifiable entity)
9595
9696 private bool ShouldIncludePageLinks ( ContextEntity entity ) => entity . Links . HasFlag ( Link . Paging ) ;
9797
98- private List < DocumentData > AppendIncludedObject ( List < DocumentData > includedObject , ContextEntity contextEntity , IIdentifiable entity )
98+ private List < ResourceObject > AppendIncludedObject ( List < ResourceObject > includedObject , ContextEntity contextEntity , IIdentifiable entity )
9999 {
100100 var includedEntities = GetIncludedEntities ( includedObject , contextEntity , entity ) ;
101101 if ( includedEntities ? . Count > 0 )
@@ -107,13 +107,12 @@ private List<DocumentData> AppendIncludedObject(List<DocumentData> includedObjec
107107 }
108108
109109 [ Obsolete ( "You should specify an IResourceDefinition implementation using the GetData/3 overload." ) ]
110- public DocumentData GetData ( ContextEntity contextEntity , IIdentifiable entity )
110+ public ResourceObject GetData ( ContextEntity contextEntity , IIdentifiable entity )
111111 => GetData ( contextEntity , entity , resourceDefinition : null ) ;
112112
113- public DocumentData GetData ( ContextEntity contextEntity , IIdentifiable entity , IResourceDefinition resourceDefinition = null )
113+ public ResourceObject GetData ( ContextEntity contextEntity , IIdentifiable entity , IResourceDefinition resourceDefinition = null )
114114 {
115- var data = new DocumentData
116- {
115+ var data = new ResourceObject {
117116 Type = contextEntity . EntityName ,
118117 Id = entity . StringId
119118 } ;
@@ -151,7 +150,7 @@ private bool OmitNullValuedAttribute(AttrAttribute attr, object attributeValue)
151150 return attributeValue == null && _documentBuilderOptions . OmitNullValuedAttributes ;
152151 }
153152
154- private void AddRelationships ( DocumentData data , ContextEntity contextEntity , IIdentifiable entity )
153+ private void AddRelationships ( ResourceObject data , ContextEntity contextEntity , IIdentifiable entity )
155154 {
156155 data . Relationships = new Dictionary < string , RelationshipData > ( ) ;
157156 contextEntity . Relationships . ForEach ( r =>
@@ -192,9 +191,9 @@ private RelationshipData GetRelationshipData(RelationshipAttribute attr, Context
192191 return relationshipData ;
193192 }
194193
195- private List < DocumentData > GetIncludedEntities ( List < DocumentData > included , ContextEntity rootContextEntity , IIdentifiable rootResource )
194+ private List < ResourceObject > GetIncludedEntities ( List < ResourceObject > included , ContextEntity rootContextEntity , IIdentifiable rootResource )
196195 {
197- if ( _jsonApiContext . IncludedRelationships != null )
196+ if ( _jsonApiContext . IncludedRelationships != null )
198197 {
199198 foreach ( var relationshipName in _jsonApiContext . IncludedRelationships )
200199 {
@@ -209,8 +208,8 @@ private List<DocumentData> GetIncludedEntities(List<DocumentData> included, Cont
209208 return included ;
210209 }
211210
212- private List < DocumentData > IncludeRelationshipChain (
213- List < DocumentData > included , ContextEntity parentEntity , IIdentifiable parentResource , string [ ] relationshipChain , int relationshipChainIndex )
211+ private List < ResourceObject > IncludeRelationshipChain (
212+ List < ResourceObject > included , ContextEntity parentEntity , IIdentifiable parentResource , string [ ] relationshipChain , int relationshipChainIndex )
214213 {
215214 var requestedRelationship = relationshipChain [ relationshipChainIndex ] ;
216215 var relationship = parentEntity . Relationships . FirstOrDefault ( r => r . PublicRelationshipName == requestedRelationship ) ;
@@ -232,10 +231,10 @@ private List<DocumentData> IncludeRelationshipChain(
232231 return included ;
233232 }
234233
235- private List < DocumentData > IncludeSingleResourceRelationships (
236- List < DocumentData > included , IIdentifiable navigationEntity , RelationshipAttribute relationship , string [ ] relationshipChain , int relationshipChainIndex )
234+ private List < ResourceObject > IncludeSingleResourceRelationships (
235+ List < ResourceObject > included , IIdentifiable navigationEntity , RelationshipAttribute relationship , string [ ] relationshipChain , int relationshipChainIndex )
237236 {
238- if ( relationshipChainIndex < relationshipChain . Length )
237+ if ( relationshipChainIndex < relationshipChain . Length )
239238 {
240239 var nextContextEntity = _jsonApiContext . ContextGraph . GetContextEntity ( relationship . Type ) ;
241240 var resource = ( IIdentifiable ) navigationEntity ;
@@ -248,12 +247,12 @@ private List<DocumentData> IncludeSingleResourceRelationships(
248247 }
249248
250249
251- private List < DocumentData > AddIncludedEntity ( List < DocumentData > entities , IIdentifiable entity )
250+ private List < ResourceObject > AddIncludedEntity ( List < ResourceObject > entities , IIdentifiable entity )
252251 {
253252 var includedEntity = GetIncludedEntity ( entity ) ;
254253
255254 if ( entities == null )
256- entities = new List < DocumentData > ( ) ;
255+ entities = new List < ResourceObject > ( ) ;
257256
258257 if ( includedEntity != null && entities . Any ( doc =>
259258 string . Equals ( doc . Id , includedEntity . Id ) && string . Equals ( doc . Type , includedEntity . Type ) ) == false )
@@ -264,7 +263,7 @@ private List<DocumentData> AddIncludedEntity(List<DocumentData> entities, IIdent
264263 return entities ;
265264 }
266265
267- private DocumentData GetIncludedEntity ( IIdentifiable entity )
266+ private ResourceObject GetIncludedEntity ( IIdentifiable entity )
268267 {
269268 if ( entity == null ) return null ;
270269
0 commit comments