If I wanted to inject some code in to my odata insert/update/delete/query end points is there a way to do this?
For example:
- On query I want to inject a security based further restraint (like if role is x then return subset of data).
- On update I want to prevent certain fields from being updated (like CreateDate), so some form of overpost protection. Or I want to not allow a regular user update administrative data columns.
- On insert/update I want to have server based logic calculate certain column values and further more trigger certain server operations.
- On delete I want to cancel the delete, insert the record in to an audit table and set the DeleteDate column of the entity - AKA soft delete.
Are these possible? Any documents/tutorials on how to do this?
Thanks