ActivatorUtilities.GetServiceOrCreateInstance Method

Indicates whether to get the service or create an instance of the specified object.

Namespace:  Microsoft.Owin.Hosting.Services
Assembly:  Microsoft.Owin.Hosting (in Microsoft.Owin.Hosting.dll)

Syntax

'Declaration
Public Shared Function GetServiceOrCreateInstance ( _
    services As IServiceProvider, _
    type As Type _
) As Object
'Usage
Dim services As IServiceProvider 
Dim type As Type 
Dim returnValue As Object 

returnValue = ActivatorUtilities.GetServiceOrCreateInstance(services, _
    type)
public static Object GetServiceOrCreateInstance(
    IServiceProvider services,
    Type type
)
public:
static Object^ GetServiceOrCreateInstance(
    IServiceProvider^ services, 
    Type^ type
)
static member GetServiceOrCreateInstance : 
        services:IServiceProvider * 
        type:Type -> Object
public static function GetServiceOrCreateInstance(
    services : IServiceProvider, 
    type : Type
) : Object

Parameters

  • type
    Type: System.Type
    The type of the specified object.

Return Value

Type: System.Object
The object that is to get the service or create an instance.

See Also

Reference

ActivatorUtilities Class

Microsoft.Owin.Hosting.Services Namespace