Skip to content

M_CodeJam_Services_ServiceProviderHelper_Publish__1

Andrew Koryavchenko edited this page Jun 17, 2018 · 5 revisions

ServiceProviderHelper.Publish(T) Method (IServicePublisher, Func(IServicePublisher, T))

Publish service.

Namespace: CodeJam.Services
Assembly: CodeJam.Blocks (in CodeJam.Blocks.dll) Version: 2.0.0.0

Syntax

C#

public static IDisposable Publish<T>(
	this IServicePublisher publisher,
	Func<IServicePublisher, T> instanceFactory
)
where T : class

VB

<ExtensionAttribute>
Public Shared Function Publish(Of T As Class) ( 
	publisher As IServicePublisher,
	instanceFactory As Func(Of IServicePublisher, T)
) As IDisposable

F#

[<ExtensionAttribute>]
static member Publish : 
        publisher : IServicePublisher * 
        instanceFactory : Func<IServicePublisher, 'T> -> IDisposable  when 'T : not struct

Parameters

 

publisher
Type: CodeJam.Services.IServicePublisher
Service publisher.
instanceFactory
Type: System.Func(IServicePublisher, T)
Factory to create service instance

Type Parameters

 

T
Type of service object to publish.

Return Value

Type: IDisposable
Disposable cookie to conceal published service

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IServicePublisher. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

ServiceProviderHelper Class
Publish Overload
CodeJam.Services Namespace

Clone this wiki locally