Table of Contents

Interface IResourceRepositoryAccessor

Namespace
JsonApiDotNetCore.Repositories
Assembly
JsonApiDotNetCore.dll

Retrieves an IResourceRepository<TResource, TId> instance from the D/I container and invokes a method on it.

public interface IResourceRepositoryAccessor

Methods

AddToToManyRelationshipAsync<TResource, TId>(TResource?, TId, ISet<IIdentifiable>, CancellationToken)

Task AddToToManyRelationshipAsync<TResource, TId>(TResource? leftResource, TId leftId, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken) where TResource : class, IIdentifiable<TId>

Parameters

leftResource TResource
leftId TId
rightResourceIds ISet<IIdentifiable>
cancellationToken CancellationToken

Returns

Task

Type Parameters

TResource
TId

CountAsync(ResourceType, FilterExpression?, CancellationToken)

Invokes CountAsync(FilterExpression?, CancellationToken) for the specified resource type.

Task<int> CountAsync(ResourceType resourceType, FilterExpression? filter, CancellationToken cancellationToken)

Parameters

resourceType ResourceType
filter FilterExpression
cancellationToken CancellationToken

Returns

Task<int>

CreateAsync<TResource>(TResource, TResource, CancellationToken)

Invokes CreateAsync(TResource, TResource, CancellationToken) for the specified resource type.

Task CreateAsync<TResource>(TResource resourceFromRequest, TResource resourceForDatabase, CancellationToken cancellationToken) where TResource : class, IIdentifiable

Parameters

resourceFromRequest TResource
resourceForDatabase TResource
cancellationToken CancellationToken

Returns

Task

Type Parameters

TResource

DeleteAsync<TResource, TId>(TResource?, TId, CancellationToken)

Invokes DeleteAsync(TResource?, TId, CancellationToken) for the specified resource type.

Task DeleteAsync<TResource, TId>(TResource? resourceFromDatabase, TId id, CancellationToken cancellationToken) where TResource : class, IIdentifiable<TId>

Parameters

resourceFromDatabase TResource
id TId
cancellationToken CancellationToken

Returns

Task

Type Parameters

TResource
TId

GetAsync(ResourceType, QueryLayer, CancellationToken)

Invokes GetAsync(QueryLayer, CancellationToken) for the specified resource type.

Task<IReadOnlyCollection<IIdentifiable>> GetAsync(ResourceType resourceType, QueryLayer queryLayer, CancellationToken cancellationToken)

Parameters

resourceType ResourceType
queryLayer QueryLayer
cancellationToken CancellationToken

Returns

Task<IReadOnlyCollection<IIdentifiable>>

GetAsync<TResource>(QueryLayer, CancellationToken)

Invokes GetAsync(QueryLayer, CancellationToken) for the specified resource type.

Task<IReadOnlyCollection<TResource>> GetAsync<TResource>(QueryLayer queryLayer, CancellationToken cancellationToken) where TResource : class, IIdentifiable

Parameters

queryLayer QueryLayer
cancellationToken CancellationToken

Returns

Task<IReadOnlyCollection<TResource>>

Type Parameters

TResource

GetForCreateAsync<TResource, TId>(Type, TId, CancellationToken)

Invokes GetForCreateAsync(Type, TId, CancellationToken) for the specified resource type.

Task<TResource> GetForCreateAsync<TResource, TId>(Type resourceClrType, TId id, CancellationToken cancellationToken) where TResource : class, IIdentifiable<TId>

Parameters

resourceClrType Type
id TId
cancellationToken CancellationToken

Returns

Task<TResource>

Type Parameters

TResource
TId

GetForUpdateAsync<TResource>(QueryLayer, CancellationToken)

Invokes GetForUpdateAsync(QueryLayer, CancellationToken) for the specified resource type.

Task<TResource?> GetForUpdateAsync<TResource>(QueryLayer queryLayer, CancellationToken cancellationToken) where TResource : class, IIdentifiable

Parameters

queryLayer QueryLayer
cancellationToken CancellationToken

Returns

Task<TResource>

Type Parameters

TResource

RemoveFromToManyRelationshipAsync<TResource>(TResource, ISet<IIdentifiable>, CancellationToken)

Task RemoveFromToManyRelationshipAsync<TResource>(TResource leftResource, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken) where TResource : class, IIdentifiable

Parameters

leftResource TResource
rightResourceIds ISet<IIdentifiable>
cancellationToken CancellationToken

Returns

Task

Type Parameters

TResource

SetRelationshipAsync<TResource>(TResource, object?, CancellationToken)

Invokes SetRelationshipAsync(TResource, object?, CancellationToken) for the specified resource type.

Task SetRelationshipAsync<TResource>(TResource leftResource, object? rightValue, CancellationToken cancellationToken) where TResource : class, IIdentifiable

Parameters

leftResource TResource
rightValue object
cancellationToken CancellationToken

Returns

Task

Type Parameters

TResource

UpdateAsync<TResource>(TResource, TResource, CancellationToken)

Invokes UpdateAsync(TResource, TResource, CancellationToken) for the specified resource type.

Task UpdateAsync<TResource>(TResource resourceFromRequest, TResource resourceFromDatabase, CancellationToken cancellationToken) where TResource : class, IIdentifiable

Parameters

resourceFromRequest TResource
resourceFromDatabase TResource
cancellationToken CancellationToken

Returns

Task

Type Parameters

TResource