Share via


DomainServiceContext.GetService Method

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Gets the service object of the specified type.

Namespace:  System.ServiceModel.DomainServices.Server
Assembly:  System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)

Syntax

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

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

Parameters

  • serviceType
    Type: System.Type
    The type of the needed service.

Return Value

Type: System.Object
A service object of type serviceType, or nulla null reference (Nothing in Visual Basic) if there is no service object of type serviceType.

Implements

IServiceProvider.GetService(Type)

See Also

Reference

DomainServiceContext Class

System.ServiceModel.DomainServices.Server Namespace