ISaveBehavior interface
namespace: Serenity.Services assembly: Serenity.Net.Services
A save behavior that can be used as a mixin within a SaveRequestHandler lifecycle
public interface ISaveBehavior
Members
name | description |
---|---|
OnAfterSave(…) | Called after row is inserted to / updated in database |
OnAudit(…) | Called after row is inserted to / updated and auditing should be performed |
OnBeforeSave(…) | Called just before row is inserted to / updated in database |
OnPrepareQuery(…) | Called when query to load old entity is built |
OnReturn(…) | Called before handler is returning the result |
OnSetInternalFields(…) | Called when internal fields in row is being set |
OnValidateRequest(…) | 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
- Source: ISaveBehavior.cs