Show / Hide Table of Contents

Class NumberAffectedResultWriter<TModel>

A result writer that simply writes the number of models affected by the request

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

The type of model to format

Constructors

| Improve this Doc View Source

NumberAffectedResultWriter(String)

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

C#
public NumberAffectedResultWriter(string templateText = "{0}")
Parameters
templateTextString

The text to use to format the response. All instances of "{0}" will be replaced with the number of models affected by the request

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