Table of Contents

Populate Method

Definition

Populate(Func<HttpExceptionDescriptor, MediaTypeHeaderValue, HttpContent>, ICollection<HttpExceptionDescriptorResponseHandler>)

Populates the underlying SupportedMediaTypes to the ExceptionDescriptorHandlers using the specified contentFactory.

public HttpExceptionDescriptorResponseFormatter<TOptions> Populate(Func<HttpExceptionDescriptor, MediaTypeHeaderValue, HttpContent> contentFactory, ICollection<HttpExceptionDescriptorResponseHandler> exceptionDescriptorHandlers = null)

Parameters

contentFactory Func<HttpExceptionDescriptor, MediaTypeHeaderValue, HttpContent>

The function delegate that will create an instance of HttpContent with input from the specified HttpExceptionDescriptor and MediaTypeHeaderValue.

exceptionDescriptorHandlers ICollection<HttpExceptionDescriptorResponseHandler>

The optional collection of HttpExceptionDescriptorResponseHandler instances to populate to.

Returns

HttpExceptionDescriptorResponseFormatter<TOptions>

A reference to this instance so that additional calls can be chained.

Exceptions

ArgumentNullException

contentFactory cannot be null.