Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to prevent removing a Master object being referenced by other objects and containing an aggregated Details collection when the Deferred Deletion feature is turned off

$
0
0

This example demonstrates how to implement your classes, to save the referential integrity of your tables when removing master objects being referenced by other objects. This solution is appropriate when you have the Deferred Deletion feature of XPO turned off. Without the code in this example, you will get an SQLException. This solution will allow you to provide your users with more meaningful exceptions, when such a situation takes place.

The Master object in this example has an aggregated One-To-Many relationship to Child objects. If a Master object has some aggregated children, it can be immediately deleted with all associated Child objects. However, if there is a Neighbour object, having a reference (without association) to this Master object, the code will raise an exception, notifying about existing referencing objects.

See Also:
Core - Introduce an automatic check to the deleting algorithm whether an object is referenced by any other object
Deferred deletion and (foreign key) exception handling


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>