Populate Method
Definition
- Namespace
- Cuemon.AspNetCore.Diagnostics
- Assemblies
- Cuemon.AspNetCore.dll
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
contentFactoryFunc<HttpExceptionDescriptor, MediaTypeHeaderValue, HttpContent>The function delegate that will create an instance of HttpContent with input from the specified HttpExceptionDescriptor and MediaTypeHeaderValue.
exceptionDescriptorHandlersICollection<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
contentFactorycannot be null.