Table of Contents

Interface IElementEndpoint

Namespace
TypedRest.Endpoints.Generic
Assembly
TypedRest.dll

Endpoint for an individual resource. Usually you will want to use the typed-variant of this interface: IElementEndpoint<TEntity>

public interface IElementEndpoint : IEndpoint
Inherited Members

Properties

DeleteAllowed

Shows whether the server has indicated that DeleteAsync(CancellationToken) is currently allowed.

bool? DeleteAllowed { get; }

Property Value

bool?

true if the method is allowed, false if the method is not allowed, null If no request has been sent yet or the server did not specify allowed methods.

Remarks

Uses cached data from last response.

Methods

DeleteAsync(CancellationToken)

Deletes the element.

Task DeleteAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Used to cancel the request.

Returns

Task

Exceptions

InvalidOperationException

The entity has changed since it was last retrieved with ReadAsync(CancellationToken). Your delete call was rejected to prevent a lost update.

InvalidDataException

BadRequest

AuthenticationException

Unauthorized

UnauthorizedAccessException

Forbidden

KeyNotFoundException

NotFound or Gone

HttpRequestException

Other non-success status code.

ExistsAsync(CancellationToken)

Determines whether the element currently exists.

Task<bool> ExistsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Used to cancel the request.

Returns

Task<bool>

Exceptions

AuthenticationException

Unauthorized

UnauthorizedAccessException

Forbidden

HttpRequestException

Other non-success status code.