Interface IQueryLayerComposer
- Namespace
- JsonApiDotNetCore.Queries
- Assembly
- JsonApiDotNetCore.dll
Takes scoped expressions from IQueryConstraintProviders and transforms them.
public interface IQueryLayerComposer
Methods
ComposeForGetById<TId>(TId, ResourceType, TopFieldSelection)
Collects constraints and builds a QueryLayer out of them, used to retrieve one resource.
QueryLayer ComposeForGetById<TId>(TId id, ResourceType primaryResourceType, TopFieldSelection fieldSelection)
Parameters
id
TIdprimaryResourceType
ResourceTypefieldSelection
TopFieldSelection
Returns
Type Parameters
TId
ComposeForGetRelationshipRightIds(RelationshipAttribute, ICollection<IIdentifiable>)
Builds a query for the specified relationship with a filter to match on its right resource IDs.
QueryLayer ComposeForGetRelationshipRightIds(RelationshipAttribute relationship, ICollection<IIdentifiable> rightResourceIds)
Parameters
relationship
RelationshipAttributerightResourceIds
ICollection<IIdentifiable>
Returns
ComposeForGetTargetedSecondaryResourceIds(IIdentifiable)
Builds a query for each targeted relationship with a filter to match on its right resource IDs.
IEnumerable<(QueryLayer, RelationshipAttribute)> ComposeForGetTargetedSecondaryResourceIds(IIdentifiable primaryResource)
Parameters
primaryResource
IIdentifiable
Returns
ComposeForHasMany<TId>(HasManyAttribute, TId, ICollection<IIdentifiable>)
Builds a query for a to-many relationship with a filter to match on its left and right resource IDs.
QueryLayer ComposeForHasMany<TId>(HasManyAttribute hasManyRelationship, TId leftId, ICollection<IIdentifiable> rightResourceIds)
Parameters
hasManyRelationship
HasManyAttributeleftId
TIdrightResourceIds
ICollection<IIdentifiable>
Returns
Type Parameters
TId
ComposeForUpdate<TId>(TId, ResourceType)
Builds a query that retrieves the primary resource, including all of its attributes and all targeted relationships, during a create/update/delete request.
QueryLayer ComposeForUpdate<TId>(TId id, ResourceType primaryResourceType)
Parameters
id
TIdprimaryResourceType
ResourceType
Returns
Type Parameters
TId
ComposeFromConstraints(ResourceType)
Collects constraints and builds a QueryLayer out of them, used to retrieve the actual resources.
QueryLayer ComposeFromConstraints(ResourceType requestResourceType)
Parameters
requestResourceType
ResourceType
Returns
ComposeSecondaryLayerForRelationship(ResourceType)
Collects constraints and builds the secondary layer for a relationship endpoint.
QueryLayer ComposeSecondaryLayerForRelationship(ResourceType secondaryResourceType)
Parameters
secondaryResourceType
ResourceType
Returns
GetPrimaryFilterFromConstraints(ResourceType)
Builds a filter from constraints, used to determine total resource count on a primary collection endpoint.
FilterExpression? GetPrimaryFilterFromConstraints(ResourceType primaryResourceType)
Parameters
primaryResourceType
ResourceType
Returns
GetSecondaryFilterFromConstraints<TId>(TId, HasManyAttribute)
Builds a filter from constraints, used to determine total resource count on a secondary collection endpoint.
FilterExpression? GetSecondaryFilterFromConstraints<TId>(TId primaryId, HasManyAttribute hasManyRelationship)
Parameters
primaryId
TIdhasManyRelationship
HasManyAttribute
Returns
Type Parameters
TId
WrapLayerForSecondaryEndpoint<TId>(QueryLayer, ResourceType, TId, RelationshipAttribute)
Wraps a layer for a secondary endpoint into a primary layer, rewriting top-level includes.
QueryLayer WrapLayerForSecondaryEndpoint<TId>(QueryLayer secondaryLayer, ResourceType primaryResourceType, TId primaryId, RelationshipAttribute relationship)
Parameters
secondaryLayer
QueryLayerprimaryResourceType
ResourceTypeprimaryId
TIdrelationship
RelationshipAttribute
Returns
Type Parameters
TId