preSaveAction property
Action Execute pre save. (Perform actions before each insert/update)
Example:
@SqfEntityBuilder(myDbModel)
const myDbModel = SqfEntityModel(
...
preSaveAction: getPreSaveAction,
);
Future<TableBase> getPreSaveAction(String tableName, obj) async {
// Update the lastUpdate column on all records before saving
obj.lastUpdate = DateTime.now()
return obj;
}
Implementation
final PreSaveAction? preSaveAction;