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
endpoint
IIndexerEndpoint<TElementEndpoint>The collection endpoint containing the element.
id
stringThe ID identifying the entity in the collection.
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
Type Parameters
TElementEndpoint
The 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
endpoint
ICollectionEndpoint<TEntity, TElementEndpoint>The collection endpoint containing the element.
element
TEntityThe element to be checked.
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
Type Parameters
TEntity
The type of individual elements in the collection.
TElementEndpoint
The type of IEndpoint to provide for individual
TEntity
s.
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
endpoint
IIndexerEndpoint<TElementEndpoint>The collection endpoint containing the element.
id
stringThe ID identifying the entity in the collection.
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
Type Parameters
TElementEndpoint
The 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
endpoint
ICollectionEndpoint<TEntity, TElementEndpoint>The collection endpoint containing the element.
element
TEntityThe element to be deleted.
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
Type Parameters
TEntity
The type of individual elements in the collection.
TElementEndpoint
The type of IEndpoint to provide for individual
TEntity
s.
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
endpoint
ICollectionEndpoint<TEntity, TElementEndpoint>The collection endpoint containing the element.
element
TEntityThe
TEntity
data to merge with the existing element.cancellationToken
CancellationTokenUsed to cancel the request.
Returns
- Task<TEntity>
The
TEntity
as returned by the server, possibly with additional fields set.null
if the server does not respond with a result entity.
Type Parameters
TEntity
The type of individual elements in the collection.
TElementEndpoint
The type of IEndpoint to provide for individual
TEntity
s.
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
endpoint
ICollectionEndpoint<TEntity, TElementEndpoint>The collection endpoint containing the element.
element
TEntityThe new state of the element.
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
- Task<TEntity>
The
TEntity
as returned by the server, possibly with additional fields set.null
if the server does not respond with a result entity.
Type Parameters
TEntity
The type of individual elements in the collection.
TElementEndpoint
The type of IEndpoint to provide for individual
TEntity
s.
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.