Table of Contents

Interface IInfoObjectEventHandler<TInfoObjectEvent>

Namespace
CMS.DataEngine
Assembly
CMS.DataEngine.dll

Represents a handler for info object events. Info object event is a compound event consisting of before and after event handling (such as InfoObjectBeforeInsertEvent<TInfo> and InfoObjectAfterInsertEvent<TInfo>).

public interface IInfoObjectEventHandler<in TInfoObjectEvent> where TInfoObjectEvent : IInfoObjectEvent

Type Parameters

TInfoObjectEvent

Type of the info object event handled.

Extension Methods

Remarks

Use AddInfoObjectEventHandler<TInfoObjectEvent, THandler>(IServiceCollection) to register an event handler.

Based on whether the event is invoked from a synchronous or asynchronous execution context the synchronous or asynchronous handling members are invoked.

A singleton handler instance is used for all event occurrences. The implementing handler can store state between the before and after event handling stage using the State members.

Methods

Handle(TInfoObjectEvent)

Handles custom actions when the event is invoked from a synchronous execution context.

void Handle(TInfoObjectEvent infoObjectEvent)

Parameters

infoObjectEvent TInfoObjectEvent

Event which caused the handling to be invoked.

HandleAsync(TInfoObjectEvent, CancellationToken)

Handles custom actions when the event is invoked from an asynchronous execution context.

Task HandleAsync(TInfoObjectEvent infoObjectEvent, CancellationToken cancellationToken)

Parameters

infoObjectEvent TInfoObjectEvent

Event which caused the handling to be invoked.

cancellationToken CancellationToken

The cancellation instruction.

Returns

Task

See Also