Class FunctionEndpoint<TEntity, TResult>
RPC endpoint that takes TEntity as input and returns TResult as output when invoked.
public class FunctionEndpoint<TEntity, TResult> : RpcEndpointBase, IFunctionEndpoint<TEntity, TResult>, IRpcEndpoint, IEndpointType Parameters
- TEntity
- The type of entity the endpoint takes as input. 
- TResult
- The type of entity the endpoint returns as output. 
- Inheritance
- 
      
      
      
      FunctionEndpoint<TEntity, TResult>
- Implements
- 
      IFunctionEndpoint<TEntity, TResult>
- Inherited Members
Constructors
FunctionEndpoint(IEndpoint, string)
Creates a new function endpoint with a relative URI.
public FunctionEndpoint(IEndpoint referrer, string relativeUri)Parameters
- referrerIEndpoint
- The endpoint used to navigate to this one. 
- relativeUristring
- The URI of this endpoint relative to the - referrer's. Add a- ./prefix here to imply a trailing slash- referrer's URI.
FunctionEndpoint(IEndpoint, Uri)
Creates a new function endpoint with a relative URI.
public FunctionEndpoint(IEndpoint referrer, Uri relativeUri)Parameters
- referrerIEndpoint
- The endpoint used to navigate to this one. 
- relativeUriUri
- The URI of this endpoint relative to the - referrer's.
Methods
InvokeAsync(TEntity, CancellationToken)
Invokes the function.
public Task<TResult> InvokeAsync(TEntity entity, CancellationToken cancellationToken = default)Parameters
- entityTEntity
- The entity to post as input. 
- cancellationTokenCancellationToken
- Used to cancel the request. 
Returns
- Task<TResult>
- The result returned by the server. 
Exceptions
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
- Other non-success status code.