Skip to content

SyncToAsyncDeleteBehaviorWrapper class

namespace: Serenity.Services   assemblySerenity.Net.Services

Wraps an IDeleteBehaviorSync implementation and exposes it as an IDeleteBehaviorAsync. This allows asynchronous delete request handlers to run synchronous delete behaviors.

public class SyncToAsyncDeleteBehaviorWrapper : IDeleteBehaviorAsync, IWrappedBehavior

Public Members

name description
SyncToAsyncDeleteBehaviorWrapper(…) Wraps an IDeleteBehaviorSync implementation and exposes it as an IDeleteBehaviorAsync. This allows asynchronous delete request handlers to run synchronous delete behaviors.
WrappedBehavior { get; }
OnAfterDeleteAsync(…)
OnAuditAsync(…)
OnBeforeDeleteAsync(…)
OnPrepareQueryAsync(…)
OnReturnAsync(…)
OnValidateRequestAsync(…)

Remarks

A behavior instance is always cached and reused across requests, so make sure you don't store anything in private variables, and its operation is thread-safe. If you need to pass some state between events, use handler's StateBag.

See Also