Show / Hide Table of Contents

Interface IResultWriter<TModel, TUser>

Writer for API results

Namespace: Seltzr.Results
Assembly: Seltzr.dll
Syntax
C#
public interface IResultWriter<TModel, in TUser>
    where TModel : class where TUser : class
Type Parameters
TModel

The type of model to format

TUser

The type of authenticated user context

Methods

| Improve this Doc View Source

CanWriteAsync(HttpRequest)

Gets whether or not this IResultWriter<TModel, TUser> can write a result for the given request

C#
Task<bool> CanWriteAsync(HttpRequest request)
Parameters
requestHttpRequest

The request to test if a result can be written for it

Returns

Task<Boolean>

true if a result can be written for request, false otherwise

| Improve this Doc View Source

WriteResultAsync(IApiContext<TModel, TUser>, IEnumerable<TModel>, FormattingOptions)

Formats the API result

C#
Task WriteResultAsync(IApiContext<TModel, TUser> context, IEnumerable<TModel> data, FormattingOptions options)
Parameters
contextIApiContext<TModel, TUser>

The current API context

dataIEnumerable<TModel>

The dataset to format

optionsFormattingOptions

Options for formatting the result

Returns

Task

When the result has been sent

  • Improve this Doc
  • View Source
Back to top Generated by DocFX