Table of Contents

Class ParameterlessEndpoint<TResult>

Namespace
Phetch.Core
Assembly
Phetch.Core.dll

An alternate version of Endpoint<TArg, TResult> for queries that have no parameters.

public sealed class ParameterlessEndpoint<TResult> : Endpoint<Unit, TResult>

Type Parameters

TResult
Inheritance
Endpoint<Unit, TResult>
ParameterlessEndpoint<TResult>
Inherited Members

Constructors

ParameterlessEndpoint(Func<CancellationToken, Task<TResult>>, EndpointOptions<Unit, TResult>?)

Creates a new Endpoint from a query function with no parameters.

public ParameterlessEndpoint(Func<CancellationToken, Task<TResult>> queryFn, EndpointOptions<Unit, TResult>? options = null)

Parameters

queryFn Func<CancellationToken, Task<TResult>>
options EndpointOptions<Unit, TResult>

ParameterlessEndpoint(Func<Task<TResult>>, EndpointOptions<Unit, TResult>?)

Creates a new Endpoint from a query function with no parameters and no CancellationToken.

public ParameterlessEndpoint(Func<Task<TResult>> queryFn, EndpointOptions<Unit, TResult>? options = null)

Parameters

queryFn Func<Task<TResult>>
options EndpointOptions<Unit, TResult>

Methods

Use(QueryOptions<Unit, TResult>?)

Creates a new Query<TArg, TResult> object, which can be used to make queries to this endpoint.

public Query<TResult> Use(QueryOptions<Unit, TResult>? options = null)

Parameters

options QueryOptions<Unit, TResult>

Additional options to use when querying

Returns

Query<TResult>

A new Query<TArg, TResult> object which shares the same cache as other queries from this endpoint.

Remarks

This does not fetch the query immediately. Instead, you should call Fetch<TResult>(IQuery<Unit, TResult>) on the returned query.