Class DependencyInjectionConsumerProvider
- Namespace
- ReflectionEventing.DependencyInjection
- Assembly
- ReflectionEventing.DependencyInjection.dll
Represents a provider for retrieving event consumers from .NET Core's built-in dependency injection container.
public class DependencyInjectionConsumerProvider : IConsumerProvider
- Inheritance
-
DependencyInjectionConsumerProvider
- Implements
- Inherited Members
Constructors
DependencyInjectionConsumerProvider(IServiceProvider)
Represents a provider for retrieving event consumers from .NET Core's built-in dependency injection container.
public DependencyInjectionConsumerProvider(IServiceProvider serviceProvider)
Parameters
serviceProviderIServiceProvider
Methods
GetConsumers(Type)
Gets the consumers objects for the specified event type.
public IEnumerable<object?> GetConsumers(Type consumerType)
Parameters
consumerTypeTypeThe type of the event that the consumers handle.
Returns
- IEnumerable<object>
An enumerable of object's that are consumers of the specified event type.
Examples
Type consumerType = typeof(MyEvent);
IEnumerable<object> consumerTypes = consumerProvider.GetConsumers(consumerType);