Skip to content

ISaveBehaviorAsync interface

namespace: Serenity.Services   assemblySerenity.Net.Services

An asynchronous save behavior that can be used as a mixin within a SaveRequestHandlerAsync lifecycle

public interface ISaveBehaviorAsync : ISaveBehavior

Members

name description
OnAfterSaveAsync(…) Called after row is inserted to / updated in database
OnAuditAsync(…) Called after row is inserted to / updated and auditing should be performed
OnBeforeSaveAsync(…) Called just before row is inserted to / updated in database
OnPrepareQueryAsync(…) Called when query to load old entity is built
OnReturnAsync(…) Called before handler is returning the result
OnSetInternalFieldsAsync(…) Called when internal fields in row is being set
OnValidateRequestAsync(…) Called when save request is validated

Remarks

A save 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