ServiceProvider.Add Method
Adds a specified service provider.
Namespace: Microsoft.Owin.Hosting.Services
Assembly: Microsoft.Owin.Hosting (in Microsoft.Owin.Hosting.dll)
Overload List
Name | Description | |
---|---|---|
![]() |
Add(Type, Func<Object>) | Specify that services of the given type should be created with the given serviceFactory. |
![]() |
Add(Type, Type) | Specify that services of the type serviceType should be fulfilled by the type implementationType. |
![]() |
Add<TService, TImplementation>() | Specify that services of the type TService should be fulfilled by the type TImplementation. |
See Also
ServiceProvider Class
Microsoft.Owin.Hosting.Services Namespace
Return to top
ServiceProvider.Add Method (Type, Func<Object>)
Specify that services of the given type should be created with the given serviceFactory.
Syntax
public virtual ServiceProvider Add(
Type serviceType,
Func<object> serviceFactory
)
public:
virtual ServiceProvider^ Add(
Type^ serviceType,
Func<Object^>^ serviceFactory
)
abstract Add :
serviceType:Type *
serviceFactory:Func<Object> -> ServiceProvider
override Add :
serviceType:Type *
serviceFactory:Func<Object> -> ServiceProvider
Public Overridable Function Add (
serviceType As Type,
serviceFactory As Func(Of Object)
) As ServiceProvider
Parameters
- serviceType
Type: System.Type
- serviceFactory
Type: System.Func<Object>
Return Value
Type: Microsoft.Owin.Hosting.Services.ServiceProvider
Returns ServiceProvider.
Return to top
ServiceProvider.Add Method (Type, Type)
Specify that services of the type serviceType should be fulfilled by the type implementationType.
Syntax
public virtual ServiceProvider Add(
Type serviceType,
Type implementationType
)
public:
virtual ServiceProvider^ Add(
Type^ serviceType,
Type^ implementationType
)
abstract Add :
serviceType:Type *
implementationType:Type -> ServiceProvider
override Add :
serviceType:Type *
implementationType:Type -> ServiceProvider
Public Overridable Function Add (
serviceType As Type,
implementationType As Type
) As ServiceProvider
Parameters
- serviceType
Type: System.Type
- implementationType
Type: System.Type
Return Value
Type: Microsoft.Owin.Hosting.Services.ServiceProvider
Returns ServiceProvider.
Return to top
ServiceProvider.Add<TService, TImplementation> Method ()
Specify that services of the type TService should be fulfilled by the type TImplementation.
Syntax
public virtual ServiceProvider Add<TService, TImplementation>()
public:
generic<typename TService, typename TImplementation>
virtual ServiceProvider^ Add()
abstract Add<'TService, 'TImplementation> : unit -> ServiceProvider
override Add<'TService, 'TImplementation> : unit -> ServiceProvider
Public Overridable Function Add(Of TService, TImplementation) As ServiceProvider
Return Value
Type: Microsoft.Owin.Hosting.Services.ServiceProvider
Returns ServiceProvider.
Type Parameters
- TService
- TImplementation
Return to top