IntegrityContainer.RegisterFactory<TServiceType>(Func<TServiceType>) Method

Registers a delegate to resolve an instance of the specified type with a specified TServiceType key.

Namespace: DevExpress.Utils.IoC

Assembly: DevExpress.Data.v20.1.dll

Declaration

public FactoryRegistration RegisterFactory<TServiceType>(
    Func<TServiceType> factory
)
Public Function RegisterFactory(Of TServiceType)(
    factory As Func(Of TServiceType)
) As FactoryRegistration

Parameters

Name Type Description
factory Func<TServiceType>

A function, specifying the type to resolve.

Type Parameters

Name
TServiceType

Returns

Type Description
FactoryRegistration

A FactoryRegistration object.

Remarks

The following example illustrates how to use this method.


integrityContainer.RegisterFactory<IFoobar>(() => Factory.Create());
See Also