Skip to content

SyncToAsyncListBehaviorWrapper class

namespace: Serenity.Services   assemblySerenity.Net.Services

Wraps an IListBehaviorSync implementation and exposes it as an IListBehaviorAsync. This allows asynchronous list request handlers to run synchronous list behaviors.

public class SyncToAsyncListBehaviorWrapper : IListBehaviorAsync, IWrappedBehavior

Public Members

name description
SyncToAsyncListBehaviorWrapper(…) Wraps an IListBehaviorSync implementation and exposes it as an IListBehaviorAsync. This allows asynchronous list request handlers to run synchronous list behaviors.
WrappedBehavior { get; }
OnAfterExecuteQueryAsync(…)
OnApplyFiltersAsync(…)
OnBeforeExecuteQueryAsync(…)
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