Actions classes
This information is still applicable to v6
This page provides some common scenarios to use the PersistentObjectActions class.
Soft Delete
By default, Vidyano will tell Entity Framework to delete an entity from the target context when the end user uses the Delete action. We can override this behavior so that the entity is not actually deleted but only marked as deleted (e.g. disabled, not active, obsolete, …).
Cascade Delete
Another common scenario is to delete related entities when a master entity is deleted (in most cases this can also be done on the database using cascade delete on the foreign key).
Auditing
Setting audit attributes can be easily implemented by using the UpdateEntity method to set the attributes.
External services
If we need to inform another external service about new or updated entities we can use the following code.
Last updated
Was this helpful?