Interface IResourceDefinitionAccessor
- Namespace
- JsonApiDotNetCore.Resources
- Assembly
- JsonApiDotNetCore.dll
Retrieves an IResourceDefinition<TResource, TId> instance from the D/I container and invokes a callback on it.
public interface IResourceDefinitionAccessor
Properties
IsReadOnlyRequest
Indicates whether this request targets only fetching of data (resources and relationships), as opposed to applying changes.
[Obsolete("Use IJsonApiRequest.IsReadOnly.")]
bool IsReadOnlyRequest { get; }
Property Value
Remarks
This property was added to reduce the impact of taking a breaking change. It will likely be removed in the next major version.
QueryableBuilder
Gets an IQueryableBuilder instance from the service container.
[Obsolete("Use injected IQueryableBuilder instead.")]
IQueryableBuilder QueryableBuilder { get; }
Property Value
Remarks
This property was added to reduce the impact of taking a breaking change. It will likely be removed in the next major version.
Methods
GetMeta(ResourceType, IIdentifiable)
Invokes GetMeta(TResource) for the specified resource.
IDictionary<string, object?>? GetMeta(ResourceType resourceType, IIdentifiable resourceInstance)
Parameters
resourceType
ResourceTyperesourceInstance
IIdentifiable
Returns
GetQueryableHandlerForQueryStringParameter(Type, string)
Invokes OnRegisterQueryableHandlersForQueryStringParameters() for the specified resource type, then returns the IQueryable<T> expression for the specified parameter name.
object? GetQueryableHandlerForQueryStringParameter(Type resourceClrType, string parameterName)
Parameters
Returns
OnAddToRelationshipAsync<TResource>(TResource, HasManyAttribute, ISet<IIdentifiable>, CancellationToken)
Invokes OnAddToRelationshipAsync(TResource, HasManyAttribute, ISet<IIdentifiable>, CancellationToken) for the specified resource.
Task OnAddToRelationshipAsync<TResource>(TResource leftResource, HasManyAttribute hasManyRelationship, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken) where TResource : class, IIdentifiable
Parameters
leftResource
TResourcehasManyRelationship
HasManyAttributerightResourceIds
ISet<IIdentifiable>cancellationToken
CancellationToken
Returns
Type Parameters
TResource
OnApplyFilter(ResourceType, FilterExpression?)
Invokes OnApplyFilter(FilterExpression?) for the specified resource type.
FilterExpression? OnApplyFilter(ResourceType resourceType, FilterExpression? existingFilter)
Parameters
resourceType
ResourceTypeexistingFilter
FilterExpression
Returns
OnApplyIncludes(ResourceType, IImmutableSet<IncludeElementExpression>)
Invokes OnApplyIncludes(IImmutableSet<IncludeElementExpression>) for the specified resource type.
IImmutableSet<IncludeElementExpression> OnApplyIncludes(ResourceType resourceType, IImmutableSet<IncludeElementExpression> existingIncludes)
Parameters
resourceType
ResourceTypeexistingIncludes
IImmutableSet<IncludeElementExpression>
Returns
OnApplyPagination(ResourceType, PaginationExpression?)
Invokes OnApplyPagination(PaginationExpression?) for the specified resource type.
PaginationExpression? OnApplyPagination(ResourceType resourceType, PaginationExpression? existingPagination)
Parameters
resourceType
ResourceTypeexistingPagination
PaginationExpression
Returns
OnApplySort(ResourceType, SortExpression?)
Invokes OnApplySort(SortExpression?) for the specified resource type.
SortExpression? OnApplySort(ResourceType resourceType, SortExpression? existingSort)
Parameters
resourceType
ResourceTypeexistingSort
SortExpression
Returns
OnApplySparseFieldSet(ResourceType, SparseFieldSetExpression?)
Invokes OnApplySparseFieldSet(SparseFieldSetExpression?) for the specified resource type.
SparseFieldSetExpression? OnApplySparseFieldSet(ResourceType resourceType, SparseFieldSetExpression? existingSparseFieldSet)
Parameters
resourceType
ResourceTypeexistingSparseFieldSet
SparseFieldSetExpression
Returns
OnDeserialize(IIdentifiable)
Invokes OnDeserialize(TResource) for the specified resource.
void OnDeserialize(IIdentifiable resource)
Parameters
resource
IIdentifiable
OnPrepareWriteAsync<TResource>(TResource, WriteOperationKind, CancellationToken)
Invokes OnPrepareWriteAsync(TResource, WriteOperationKind, CancellationToken) for the specified resource.
Task OnPrepareWriteAsync<TResource>(TResource resource, WriteOperationKind writeOperation, CancellationToken cancellationToken) where TResource : class, IIdentifiable
Parameters
resource
TResourcewriteOperation
WriteOperationKindcancellationToken
CancellationToken
Returns
Type Parameters
TResource
OnRemoveFromRelationshipAsync<TResource>(TResource, HasManyAttribute, ISet<IIdentifiable>, CancellationToken)
Invokes OnRemoveFromRelationshipAsync(TResource, HasManyAttribute, ISet<IIdentifiable>, CancellationToken) for the specified resource.
Task OnRemoveFromRelationshipAsync<TResource>(TResource leftResource, HasManyAttribute hasManyRelationship, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken) where TResource : class, IIdentifiable
Parameters
leftResource
TResourcehasManyRelationship
HasManyAttributerightResourceIds
ISet<IIdentifiable>cancellationToken
CancellationToken
Returns
Type Parameters
TResource
OnSerialize(IIdentifiable)
Invokes OnSerialize(TResource) for the specified resource.
void OnSerialize(IIdentifiable resource)
Parameters
resource
IIdentifiable
OnSetToManyRelationshipAsync<TResource>(TResource, HasManyAttribute, ISet<IIdentifiable>, WriteOperationKind, CancellationToken)
Invokes OnSetToManyRelationshipAsync(TResource, HasManyAttribute, ISet<IIdentifiable>, WriteOperationKind, CancellationToken) for the specified resource.
Task OnSetToManyRelationshipAsync<TResource>(TResource leftResource, HasManyAttribute hasManyRelationship, ISet<IIdentifiable> rightResourceIds, WriteOperationKind writeOperation, CancellationToken cancellationToken) where TResource : class, IIdentifiable
Parameters
leftResource
TResourcehasManyRelationship
HasManyAttributerightResourceIds
ISet<IIdentifiable>writeOperation
WriteOperationKindcancellationToken
CancellationToken
Returns
Type Parameters
TResource
OnSetToOneRelationshipAsync<TResource>(TResource, HasOneAttribute, IIdentifiable?, WriteOperationKind, CancellationToken)
Invokes OnSetToOneRelationshipAsync(TResource, HasOneAttribute, IIdentifiable?, WriteOperationKind, CancellationToken) for the specified resource.
Task<IIdentifiable?> OnSetToOneRelationshipAsync<TResource>(TResource leftResource, HasOneAttribute hasOneRelationship, IIdentifiable? rightResourceId, WriteOperationKind writeOperation, CancellationToken cancellationToken) where TResource : class, IIdentifiable
Parameters
leftResource
TResourcehasOneRelationship
HasOneAttributerightResourceId
IIdentifiablewriteOperation
WriteOperationKindcancellationToken
CancellationToken
Returns
Type Parameters
TResource
OnWriteSucceededAsync<TResource>(TResource, WriteOperationKind, CancellationToken)
Invokes OnWriteSucceededAsync(TResource, WriteOperationKind, CancellationToken) for the specified resource.
Task OnWriteSucceededAsync<TResource>(TResource resource, WriteOperationKind writeOperation, CancellationToken cancellationToken) where TResource : class, IIdentifiable
Parameters
resource
TResourcewriteOperation
WriteOperationKindcancellationToken
CancellationToken
Returns
Type Parameters
TResource
OnWritingAsync<TResource>(TResource, WriteOperationKind, CancellationToken)
Invokes OnWritingAsync(TResource, WriteOperationKind, CancellationToken) for the specified resource.
Task OnWritingAsync<TResource>(TResource resource, WriteOperationKind writeOperation, CancellationToken cancellationToken) where TResource : class, IIdentifiable
Parameters
resource
TResourcewriteOperation
WriteOperationKindcancellationToken
CancellationToken
Returns
Type Parameters
TResource