Namespace TypedRest.Endpoints.Rpc
RPC endpoints allow you to interact with non-RESTful resources that act like callable functions.
Not every resource is a noun. For the ones that are verbs like "reindex", "calculate", or "send invitation", these endpoints model an HTTP POST as a method call. Which of the four types you pick follows the same reasoning as choosing between Action, Action<T>, Func<T> and Func<TIn, TOut> in C#: it depends on whether the call takes an entity, returns one, both or neither. See Action, Consumer, Producer and Function endpoints.
Whether such an operation is available often depends on the current state of the system or the user's permissions. ProbeAsync() asks the server (via HTTP OPTIONS) and reflects the answer in InvokeAllowed, so a UI can grey out a button without duplicating the server's business rules.
Classes
- ActionEndpoint
RPC endpoint that is invoked with no input or output.
- ConsumerEndpoint<TEntity>
RPC endpoint that takes
TEntityas input when invoked.
- FunctionEndpoint<TEntity, TResult>
RPC endpoint that takes
TEntityas input and returnsTResultas output when invoked.
- ProducerEndpoint<TResult>
RPC endpoint that returns
TResultas output when invoked.
- RpcEndpointBase
Base class for building RPC endpoints.
Interfaces
- IActionEndpoint
RPC endpoint that is invoked with no input or output.
- IConsumerEndpoint<TEntity>
RPC endpoint that takes
TEntityas input when invoked.
- IFunctionEndpoint<TEntity, TResult>
RPC endpoint that takes
TEntityas input and returnsTResultas output when invoked.
- IProducerEndpoint<TResult>
RPC endpoint that takes no input and returns
TResultas output when invoked.
- IRpcEndpoint
An endpoint for a non-RESTful resource that acts like a callable function.