ServiceProvider.AddInstance Method (Type, Object)

Adds an instance of service provider.

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

Syntax

'Declaration
Public Overridable Function AddInstance ( _
    service As Type, _
    instance As Object _
) As ServiceProvider
'Usage
Dim instance As ServiceProvider 
Dim service As Type 
Dim instance As Object 
Dim returnValue As ServiceProvider 

returnValue = instance.AddInstance(service, _
    instance)
public virtual ServiceProvider AddInstance(
    Type service,
    Object instance
)
public:
virtual ServiceProvider^ AddInstance(
    Type^ service, 
    Object^ instance
)
abstract AddInstance : 
        service:Type * 
        instance:Object -> ServiceProvider  
override AddInstance : 
        service:Type * 
        instance:Object -> ServiceProvider
public function AddInstance(
    service : Type, 
    instance : Object
) : ServiceProvider

Parameters

  • service
    Type: System.Type
    The type of the service to add.
  • instance
    Type: System.Object
    An instance of service provider to add.

Return Value

Type: Microsoft.Owin.Hosting.Services.ServiceProvider
The added ServiceProvider object.

See Also

Reference

ServiceProvider Class

AddInstance Overload

Microsoft.Owin.Hosting.Services Namespace