Show / Hide Table of Contents

Class ServiceHelper

A service helper.

Inheritance
System.Object
ServiceHelper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Services
Assembly: Kephas.Core.dll
Syntax
public static class ServiceHelper

Methods

| Improve this Doc View Source

Finalize(Object, IContext)

Finalizes the service.

Declaration
public static void Finalize(object service, IContext context = null)
Parameters
Type Name Description
System.Object service

The service.

IContext context

Optional. The context.

Remarks

If the service implements IAsyncFinalizable, the FinalizeAsync(IContext, CancellationToken) method is called synchronously. If the service implements IFinalizable, the Finalize(IContext) method is called. If the service implements System.IDisposable, the System.IDisposable.Dispose() method is called. Otherwise nothing happens.

| Improve this Doc View Source

FinalizeAsync(Object, IContext, CancellationToken)

Finalizes the service asynchronously.

Declaration
public static Task FinalizeAsync(object service, IContext context = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Object service

The service.

IContext context

Optional. The context.

System.Threading.CancellationToken cancellationToken

Optional. A token that allows processing to be cancelled.

Returns
Type Description
System.Threading.Tasks.Task

An asynchronous result.

Remarks

If the service implements IAsyncFinalizable, the FinalizeAsync(IContext, CancellationToken) method is called and its result is returned. If the service implements IFinalizable, the Finalize(IContext) method is called and a completed task is returned. If the service implements System.IDisposable, the System.IDisposable.Dispose() method is called and a completed task is returned. Otherwise nothing happens.

| Improve this Doc View Source

Initialize(Object, IContext)

Initializes the service.

Declaration
public static void Initialize(object service, IContext context = null)
Parameters
Type Name Description
System.Object service

The service.

IContext context

Optional. The context.

Remarks

If the service implements IAsyncInitializable, the InitializeAsync(IContext, CancellationToken) method is synchronously called. If the service implements IInitializable, the Initialize(IContext) method is called. Otherwise nothing happens.

| Improve this Doc View Source

InitializeAsync(Object, IContext, CancellationToken)

Initializes the service asynchronously.

Declaration
public static Task InitializeAsync(object service, IContext context = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Object service

The service.

IContext context

Optional. The context.

System.Threading.CancellationToken cancellationToken

Optional. A token that allows processing to be cancelled.

Returns
Type Description
System.Threading.Tasks.Task

An asynchronous result.

Remarks

If the service implements IAsyncInitializable, the InitializeAsync(IContext, CancellationToken) method is called and its result is returned. If the service implements IInitializable, the Initialize(IContext) method is called and a completed task is returned. Otherwise nothing happens.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX