@@ -13,27 +13,27 @@ namespace JsonApiDotNetCore.Internal
1313 public class ResourceGraph : IResourceGraph
1414 {
1515 internal List < ValidationResult > ValidationResults { get ; }
16- private List < ContextEntity > _entities { get ; }
16+ private List < ResourceContext > _entities { get ; }
1717
18- public ResourceGraph ( List < ContextEntity > entities , List < ValidationResult > validationResults = null )
18+ public ResourceGraph ( List < ResourceContext > entities , List < ValidationResult > validationResults = null )
1919 {
2020 _entities = entities ;
2121 ValidationResults = validationResults ;
2222 }
2323
2424 /// <inheritdoc />
25- public ContextEntity [ ] GetContextEntities ( ) => _entities . ToArray ( ) ;
25+ public ResourceContext [ ] GetContextEntities ( ) => _entities . ToArray ( ) ;
2626
2727 /// <inheritdoc />
28- public ContextEntity GetContextEntity ( string entityName )
28+ public ResourceContext GetResourceContext ( string entityName )
2929 => _entities . SingleOrDefault ( e => string . Equals ( e . EntityName , entityName , StringComparison . OrdinalIgnoreCase ) ) ;
3030
3131 /// <inheritdoc />
32- public ContextEntity GetContextEntity ( Type entityType )
32+ public ResourceContext GetResourceContext ( Type entityType )
3333 => _entities . SingleOrDefault ( e => e . EntityType == entityType ) ;
3434 /// <inheritdoc />
35- public ContextEntity GetContextEntity < TResource > ( ) where TResource : class , IIdentifiable
36- => GetContextEntity ( typeof ( TResource ) ) ;
35+ public ResourceContext GetResourceContext < TResource > ( ) where TResource : class , IIdentifiable
36+ => GetResourceContext ( typeof ( TResource ) ) ;
3737
3838 /// <inheritdoc/>
3939 public List < IResourceField > GetFields < T > ( Expression < Func < T , dynamic > > selector = null ) where T : IIdentifiable
@@ -53,24 +53,24 @@ public List<RelationshipAttribute> GetRelationships<T>(Expression<Func<T, dynami
5353 /// <inheritdoc/>
5454 public List < IResourceField > GetFields ( Type type )
5555 {
56- return GetContextEntity ( type ) . Fields . ToList ( ) ;
56+ return GetResourceContext ( type ) . Fields . ToList ( ) ;
5757 }
5858 /// <inheritdoc/>
5959 public List < AttrAttribute > GetAttributes ( Type type )
6060 {
61- return GetContextEntity ( type ) . Attributes . ToList ( ) ;
61+ return GetResourceContext ( type ) . Attributes . ToList ( ) ;
6262 }
6363 /// <inheritdoc/>
6464 public List < RelationshipAttribute > GetRelationships ( Type type )
6565 {
66- return GetContextEntity ( type ) . Relationships . ToList ( ) ;
66+ return GetResourceContext ( type ) . Relationships . ToList ( ) ;
6767 }
6868
6969 /// <inheritdoc />
7070 public RelationshipAttribute GetInverse ( RelationshipAttribute relationship )
7171 {
7272 if ( relationship . InverseNavigation == null ) return null ;
73- return GetContextEntity ( relationship . DependentType )
73+ return GetResourceContext ( relationship . DependentType )
7474 . Relationships
7575 . SingleOrDefault ( r => r . InternalRelationshipName == relationship . InverseNavigation ) ;
7676 }
@@ -79,11 +79,11 @@ private IEnumerable<IResourceField> Getter<T>(Expression<Func<T, dynamic>> selec
7979 {
8080 IEnumerable < IResourceField > available ;
8181 if ( type == FieldFilterType . Attribute )
82- available = GetContextEntity ( typeof ( T ) ) . Attributes . Cast < IResourceField > ( ) ;
82+ available = GetResourceContext ( typeof ( T ) ) . Attributes . Cast < IResourceField > ( ) ;
8383 else if ( type == FieldFilterType . Relationship )
84- available = GetContextEntity ( typeof ( T ) ) . Relationships . Cast < IResourceField > ( ) ;
84+ available = GetResourceContext ( typeof ( T ) ) . Relationships . Cast < IResourceField > ( ) ;
8585 else
86- available = GetContextEntity ( typeof ( T ) ) . Fields ;
86+ available = GetResourceContext ( typeof ( T ) ) . Fields ;
8787
8888 if ( selector == null )
8989 return available ;
0 commit comments