Creates an instance from a service provider given a service descriptor.
- Namespace
- Statiq
.Common - Containing Type
- I
Service Provider Extensions
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 |