Partager via


ControllerServices.GetService Method

Gets a service of the specified type.

Namespace:  System.Web.Http.Controllers
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

'Declaration
Public Overrides Function GetService ( _
    serviceType As Type _
) As Object
'Usage
Dim instance As ControllerServices 
Dim serviceType As Type 
Dim returnValue As Object 

returnValue = instance.GetService(serviceType)
public override Object GetService(
    Type serviceType
)
public:
virtual Object^ GetService(
    Type^ serviceType
) override
abstract GetService : 
        serviceType:Type -> Object  
override GetService : 
        serviceType:Type -> Object
public override function GetService(
    serviceType : Type
) : Object

Parameters

Return Value

Type: System.Object
The first instance of the service, or null if the service is not found.

See Also

Reference

ControllerServices Class

System.Web.Http.Controllers Namespace