Class HttpExceptionDescriptorResponseFormatterExtensions
- Namespace
- Cuemon.Extensions.AspNetCore.Http
- Assembly
- Cuemon.Extensions.AspNetCore.dll
Extension methods for the IHttpExceptionDescriptorResponseFormatter interface.
public static class HttpExceptionDescriptorResponseFormatterExtensions
- Inheritance
-
HttpExceptionDescriptorResponseFormatterExtensions
Examples
The following example demonstrates how to project all exception descriptor handlers from a sequence of formatters into a single enumerable sequence.
using System.Collections.Generic;
using System.Linq;
using Cuemon.AspNetCore.Diagnostics;
using Cuemon.Extensions.AspNetCore.Http;
namespace Examples;
public class FormatterHandlerProjection
{
public IEnumerable<HttpExceptionDescriptorResponseHandler> GetAllHandlers(IEnumerable<IHttpExceptionDescriptorResponseFormatter> formatters)
{
return formatters.SelectExceptionDescriptorHandlers();
}
}
Methods
SelectExceptionDescriptorHandlers(IEnumerable<IHttpExceptionDescriptorResponseFormatter>)
Projects each element of ExceptionDescriptorHandlers from the specified formatters into one sequence.
public static IEnumerable<HttpExceptionDescriptorResponseHandler> SelectExceptionDescriptorHandlers(this IEnumerable<IHttpExceptionDescriptorResponseFormatter> formatters)
Parameters
formattersIEnumerable<IHttpExceptionDescriptorResponseFormatter>The sequence of IHttpExceptionDescriptorResponseFormatter to extend.
Returns
- IEnumerable<HttpExceptionDescriptorResponseHandler>
A sequence of HttpExceptionDescriptorResponseHandler from the specified
formatters.
Exceptions
- ArgumentNullException
formatterscannot be null.