Table of Contents

Class IActivatorServiceExtensions

Namespace
Acuit.Pinpoint.Workstation
Assembly
Acuit.Pinpoint.Workstation.Interfaces.dll

Extension methods for IActivatorService.

public static class IActivatorServiceExtensions
Inheritance
IActivatorServiceExtensions
Inherited Members

Methods

CreateObjectInjectingDependencies<T>(IActivatorService, params KeyValuePair<Type, object>[])

Create an object, injecting dependencies into the constructor.

public static T CreateObjectInjectingDependencies<T>(this IActivatorService activatorService, params KeyValuePair<Type, object>[] additionalDependencies)

Parameters

activatorService IActivatorService

The object activator service.

additionalDependencies KeyValuePair<Type, object>[]

Additional dependencies. These will take precedence over any types provided by the active IServiceProvider.

Returns

T

The created object.

Type Parameters

T

The type to create.

Remarks

Exceptions

ArgumentNullException

activatorService is null.

InvalidOperationException

No public constructor could be found for type T for which all parameters could be injected.

MemberAccessException

The class is abstract.

TargetInvocationException

The constructor threw an exception.

CreateObjectInjectingDependencies<T>(IActivatorService, ConstructorInfo, params KeyValuePair<Type, object>[])

Create an object, injecting dependencies into a constructor.

public static T CreateObjectInjectingDependencies<T>(this IActivatorService activatorService, ConstructorInfo constructor, params KeyValuePair<Type, object>[] additionalDependencies)

Parameters

activatorService IActivatorService

The object activator service.

constructor ConstructorInfo

The constructor to invoke.

additionalDependencies KeyValuePair<Type, object>[]

Additional dependencies. These will take precedence over any types provided by the active IServiceProvider.

Returns

T

The created object.

Type Parameters

T

The type to create.

Exceptions

ArgumentNullException

activatorService is null.

ArgumentNullException

constructor is null.

ArgumentException

The declaring type of constructor is not compatible with T.

InvalidOperationException

Parameters for the constructor could not be injected.

MemberAccessException

The class is abstract.

TargetInvocationException

The constructor threw an exception.