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)
Invokes AddToToManyRelationshipAsync(TResource?, TId, ISet<IIdentifiable>, CancellationToken) for the specified resource type.
Task AddToToManyRelationshipAsync<TResource, TId>(TResource? leftResource, TId leftId, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken) where TResource : class, IIdentifiable<TId>
Parameters
leftResource
TResourceleftId
TIdrightResourceIds
ISet<IIdentifiable>cancellationToken
CancellationToken
Returns
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
ResourceTypefilter
FilterExpressioncancellationToken
CancellationToken
Returns
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
TResourceresourceForDatabase
TResourcecancellationToken
CancellationToken
Returns
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
TResourceid
TIdcancellationToken
CancellationToken
Returns
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
ResourceTypequeryLayer
QueryLayercancellationToken
CancellationToken
Returns
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
QueryLayercancellationToken
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
Typeid
TIdcancellationToken
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
QueryLayercancellationToken
CancellationToken
Returns
- Task<TResource>
Type Parameters
TResource
RemoveFromToManyRelationshipAsync<TResource>(TResource, ISet<IIdentifiable>, CancellationToken)
Invokes RemoveFromToManyRelationshipAsync(TResource, ISet<IIdentifiable>, CancellationToken) for the specified resource type.
Task RemoveFromToManyRelationshipAsync<TResource>(TResource leftResource, ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken) where TResource : class, IIdentifiable
Parameters
leftResource
TResourcerightResourceIds
ISet<IIdentifiable>cancellationToken
CancellationToken
Returns
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
TResourcerightValue
objectcancellationToken
CancellationToken
Returns
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
TResourceresourceFromDatabase
TResourcecancellationToken
CancellationToken
Returns
Type Parameters
TResource