Class CollectionEndpointExtensions
Provides extension methods for IIndexerEndpoint<TElementEndpoint> and ICollectionEndpoint<TEntity, TElementEndpoint>.
public static class CollectionEndpointExtensions
- Inheritance
-
CollectionEndpointExtensions
- Inherited Members
Methods
ContainsAsync<TElementEndpoint>(IIndexerEndpoint<TElementEndpoint>, string, CancellationToken)
Determines whether the collection contains a specific element.
public static Task<bool> ContainsAsync<TElementEndpoint>(this IIndexerEndpoint<TElementEndpoint> endpoint, string id, CancellationToken cancellationToken = default) where TElementEndpoint : IElementEndpoint
Parameters
endpointIIndexerEndpoint<TElementEndpoint>The collection endpoint containing the element.
idstringThe ID identifying the entity in the collection.
cancellationTokenCancellationTokenUsed to cancel the request.
Returns
Type Parameters
TElementEndpointThe type of IEndpoint to provide for individual entity.
Remarks
This is a convenience method equivalent to combining this[string] with ExistsAsync(CancellationToken).
Exceptions
- AuthenticationException
- UnauthorizedAccessException
- HttpRequestException
Other non-success status code.
ContainsAsync<TEntity, TElementEndpoint>(ICollectionEndpoint<TEntity, TElementEndpoint>, TEntity, CancellationToken)
Determines whether the collection contains a specific element.
public static Task<bool> ContainsAsync<TEntity, TElementEndpoint>(this ICollectionEndpoint<TEntity, TElementEndpoint> endpoint, TEntity element, CancellationToken cancellationToken = default) where TEntity : class where TElementEndpoint : IElementEndpoint<TEntity>
Parameters
endpointICollectionEndpoint<TEntity, TElementEndpoint>The collection endpoint containing the element.
elementTEntityThe element to be checked.
cancellationTokenCancellationTokenUsed to cancel the request.
Returns
Type Parameters
TEntityThe type of individual elements in the collection.
TElementEndpointThe type of IEndpoint to provide for individual
TEntitys.
Remarks
This is a convenience method equivalent to combining this[TEntity] with ExistsAsync(CancellationToken).
Exceptions
- AuthenticationException
- UnauthorizedAccessException
- HttpRequestException
Other non-success status code.
DeleteAsync<TElementEndpoint>(IIndexerEndpoint<TElementEndpoint>, string, CancellationToken)
Deletes an existing element from the collection.
public static Task DeleteAsync<TElementEndpoint>(this IIndexerEndpoint<TElementEndpoint> endpoint, string id, CancellationToken cancellationToken = default) where TElementEndpoint : IElementEndpoint
Parameters
endpointIIndexerEndpoint<TElementEndpoint>The collection endpoint containing the element.
idstringThe ID identifying the entity in the collection.
cancellationTokenCancellationTokenUsed to cancel the request.
Returns
Type Parameters
TElementEndpointThe type of IEndpoint to provide for individual entities.
Remarks
This is a convenience method equivalent to combining this[string] with DeleteAsync(CancellationToken).
Exceptions
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
Other non-success status code.
DeleteAsync<TEntity, TElementEndpoint>(ICollectionEndpoint<TEntity, TElementEndpoint>, TEntity, CancellationToken)
Deletes an existing element from the collection.
public static Task DeleteAsync<TEntity, TElementEndpoint>(this ICollectionEndpoint<TEntity, TElementEndpoint> endpoint, TEntity element, CancellationToken cancellationToken = default) where TEntity : class where TElementEndpoint : IElementEndpoint<TEntity>
Parameters
endpointICollectionEndpoint<TEntity, TElementEndpoint>The collection endpoint containing the element.
elementTEntityThe element to be deleted.
cancellationTokenCancellationTokenUsed to cancel the request.
Returns
Type Parameters
TEntityThe type of individual elements in the collection.
TElementEndpointThe type of IEndpoint to provide for individual
TEntitys.
Remarks
This is a convenience method equivalent to combining this[TEntity] with DeleteAsync(CancellationToken).
Exceptions
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
Other non-success status code.
MergeAsync<TEntity, TElementEndpoint>(ICollectionEndpoint<TEntity, TElementEndpoint>, TEntity, CancellationToken)
Modifies an existing element in the collection by merging changes on the server-side.
public static Task<TEntity?> MergeAsync<TEntity, TElementEndpoint>(this ICollectionEndpoint<TEntity, TElementEndpoint> endpoint, TEntity element, CancellationToken cancellationToken = default) where TEntity : class where TElementEndpoint : IElementEndpoint<TEntity>
Parameters
endpointICollectionEndpoint<TEntity, TElementEndpoint>The collection endpoint containing the element.
elementTEntityThe
TEntitydata to merge with the existing element.cancellationTokenCancellationTokenUsed to cancel the request.
Returns
- Task<TEntity>
The
TEntityas returned by the server, possibly with additional fields set.nullif the server does not respond with a result entity.
Type Parameters
TEntityThe type of individual elements in the collection.
TElementEndpointThe type of IEndpoint to provide for individual
TEntitys.
Remarks
This is a convenience method equivalent to combining this[TEntity] with SetAsync(TEntity, CancellationToken).
Exceptions
- InvalidDataException
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
Other non-success status code.
SetAsync<TEntity, TElementEndpoint>(ICollectionEndpoint<TEntity, TElementEndpoint>, TEntity, CancellationToken)
Sets/replaces an existing element in the collection.
public static Task<TEntity?> SetAsync<TEntity, TElementEndpoint>(this ICollectionEndpoint<TEntity, TElementEndpoint> endpoint, TEntity element, CancellationToken cancellationToken = default) where TEntity : class where TElementEndpoint : IElementEndpoint<TEntity>
Parameters
endpointICollectionEndpoint<TEntity, TElementEndpoint>The collection endpoint containing the element.
elementTEntityThe new state of the element.
cancellationTokenCancellationTokenUsed to cancel the request.
Returns
- Task<TEntity>
The
TEntityas returned by the server, possibly with additional fields set.nullif the server does not respond with a result entity.
Type Parameters
TEntityThe type of individual elements in the collection.
TElementEndpointThe type of IEndpoint to provide for individual
TEntitys.
Remarks
This is a convenience method equivalent to combining this[TEntity] with SetAsync(TEntity, CancellationToken).
Exceptions
- InvalidDataException
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
Other non-success status code.