Show / Hide Table of Contents

Class StringResultWriter<TModel>

A result writer that simply writes a static string

Inheritance
Object
StringResultWriter<TModel>
Implements
IResultWriter<TModel>
IResultWriter<TModel, Object>
Namespace: Seltzr.Results
Assembly: Seltzr.dll
Syntax
C#
public class StringResultWriter<TModel> : IResultWriter<TModel>, IResultWriter<TModel, object> where TModel : class
Type Parameters
TModel

The type of model managed by the API

Constructors

| Improve this Doc View Source

StringResultWriter(String)

Initializes a new instance of the StringResultWriter<TModel> class.

C#
public StringResultWriter(string responseText)
Parameters
responseTextString

The text to respond with

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#
public virtual Task<bool> CanWriteAsync(HttpRequest request)
Parameters
requestHttpRequest

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

Returns

Task<Boolean>

true

| Improve this Doc View Source

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

Formats the API result

C#
public virtual Task WriteResultAsync(IApiContext<TModel, object> context, IEnumerable<TModel> data, FormattingOptions options)
Parameters
contextIApiContext<TModel, Object>

The current API context

dataIEnumerable<TModel>

The dataset to format

optionsFormattingOptions

Options for formatting the result

Returns

Task

When the result has been sent

Implements

IResultWriter<TModel>
IResultWriter<TModel, TUser>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX