ServiceProviderExtensions Class
Definition
- Namespace
- Cuemon.Extensions.AspNetCore.Diagnostics
- Assemblies
- Cuemon.Extensions.AspNetCore.dll
Extension methods for the IServiceProvider interface.
public static class ServiceProviderExtensions
- Inheritance
-
objectServiceProviderExtensions
Examples
The following example demonstrates how to retrieve all registered IHttpExceptionDescriptorResponseFormatter services from the service provider.
using System;
using System.Collections.Generic;
using Cuemon.AspNetCore.Diagnostics;
using Cuemon.Extensions.AspNetCore.Diagnostics;
using Microsoft.Extensions.DependencyInjection;
namespace Examples;
public class ExceptionFormatterResolver
{
public IEnumerable<IHttpExceptionDescriptorResponseFormatter> ResolveFormatters(IServiceProvider provider)
{
return provider.GetExceptionResponseFormatters();
}
}
Methods
| Name | Description |
|---|---|
| GetExceptionResponseFormatters(IServiceProvider) | Retrieves a sequence of IHttpExceptionDescriptorResponseFormatter services from the specified |