11using System . Collections ;
22using System . Collections . Generic ;
33using System . Linq ;
4- using JsonApiDotNetCore . Extensions ;
54using JsonApiDotNetCore . Internal ;
65using JsonApiDotNetCore . Models ;
76using JsonApiDotNetCore . Services ;
@@ -148,7 +147,7 @@ private void AddRelationships(DocumentData data, ContextEntity contextEntity, II
148147 }
149148 } ;
150149
151- if ( RelationshipIsIncluded ( r . InternalRelationshipName ) )
150+ if ( RelationshipIsIncluded ( r . PublicRelationshipName ) )
152151 {
153152 var navigationEntity = _jsonApiContext . ContextGraph
154153 . GetRelationship ( entity , r . InternalRelationshipName ) ;
@@ -161,7 +160,7 @@ private void AddRelationships(DocumentData data, ContextEntity contextEntity, II
161160 relationshipData . SingleData = GetRelationship ( navigationEntity , r . InternalRelationshipName ) ;
162161 }
163162
164- data . Relationships . Add ( r . InternalRelationshipName . Dasherize ( ) , relationshipData ) ;
163+ data . Relationships . Add ( r . PublicRelationshipName , relationshipData ) ;
165164 } ) ;
166165 }
167166
@@ -171,7 +170,7 @@ private List<DocumentData> GetIncludedEntities(ContextEntity contextEntity, IIde
171170
172171 contextEntity . Relationships . ForEach ( r =>
173172 {
174- if ( ! RelationshipIsIncluded ( r . InternalRelationshipName ) ) return ;
173+ if ( ! RelationshipIsIncluded ( r . PublicRelationshipName ) ) return ;
175174
176175 var navigationEntity = _jsonApiContext . ContextGraph . GetRelationship ( entity , r . InternalRelationshipName ) ;
177176
@@ -214,7 +213,7 @@ private DocumentData GetIncludedEntity(IIdentifiable entity)
214213 private bool RelationshipIsIncluded ( string relationshipName )
215214 {
216215 return _jsonApiContext . IncludedRelationships != null &&
217- _jsonApiContext . IncludedRelationships . Contains ( relationshipName . ToProperCase ( ) ) ;
216+ _jsonApiContext . IncludedRelationships . Contains ( relationshipName ) ;
218217 }
219218
220219 private List < Dictionary < string , string > > GetRelationships ( IEnumerable < object > entities , string relationshipName )
0 commit comments