CreateInstance(IServiceProvider, ServiceDescriptor) Method
Creates an instance from a service provider given a service descriptor.
Namespace
Statiq.Common
Containing Type
IServiceProviderExtensions

Syntax

public static object CreateInstance(this IServiceProvider services, ServiceDescriptor descriptor)

Remarks

Adapted from https://greatrexpectations.com/2018/10/25/decorators-in-net-core-with-dependency-injection.

Parameters

Name Type Description
services IServiceProvider
descriptor ServiceDescriptor

Return Value

Type Description
object