Skip to content

SyncToAsyncSaveBehaviorWrapper class

namespace: Serenity.Services   assemblySerenity.Net.Services

Wraps an ISaveBehaviorSync implementation and exposes it as an ISaveBehaviorAsync. This allows asynchronous save request handlers to run synchronous save behaviors.

public class SyncToAsyncSaveBehaviorWrapper : ISaveBehaviorAsync, IWrappedBehavior

Public Members

name description
SyncToAsyncSaveBehaviorWrapper(…) Initializes a new instance of the class.
WrappedBehavior { get; }
OnAfterSaveAsync(…)
OnAuditAsync(…)
OnBeforeSaveAsync(…)
OnPrepareQueryAsync(…)
OnReturnAsync(…)
OnSetInternalFieldsAsync(…)
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