Publish Method (Type, Object)

Publishes the given service. Once published, the service instance remains in the service collection until the editing context is disposed.

Namespace:  Microsoft.Data.Tools.Design.Core.Context
Assembly:  Microsoft.Data.Tools.Design.Core (in Microsoft.Data.Tools.Design.Core.dll)

Syntax

'Declaration
Public MustOverride Sub Publish ( _
    serviceType As Type, _
    serviceInstance As Object _
)
'Usage
Dim instance As ServiceCollection
Dim serviceType As Type
Dim serviceInstance As Object

instance.Publish(serviceType, serviceInstance)
public abstract void Publish(
    Type serviceType,
    Object serviceInstance
)
public:
virtual void Publish(
    Type^ serviceType, 
    Object^ serviceInstance
) abstract
abstract Publish : 
        serviceType:Type * 
        serviceInstance:Object -> unit 
public abstract function Publish(
    serviceType : Type, 
    serviceInstance : Object
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

If serviceType or serviceInstance is null.

ArgumentException

If serviceInstance does not derive from or implement serviceType, or if serviceType has already been published.

See Also

Reference

ServiceCollection Class

Publish Overload

Microsoft.Data.Tools.Design.Core.Context Namespace