relations with "deleteaction == restrict, cascade, none" in code template
Posted: Sun 04 Jun 2017 12:20
Hello,
I am trying to find out where is the deleteaction property of the relations.
To find out if delete == cascade is ok:
(thanks to another post otherwise I would have never found it, a big "no thanks" to the people in charge of the documentation).
So let say that for the relations Many-To-1 it is enough to know if we can delete the entity or not.
But to find out if a relation Many-To-0or1 is set to "Restrict" or "Cascade" or "None" I have no idea how, it is stored in the foreign key properties but how to access the foreign key from "EntityAssociation" or "EntityRelationProperty" (or anything else why not because it is not documented) is a mystery.
Would you please be so kind to share this information?
Or really do I have to try any methods like getextendedproperties() and then try to cast the object to everything until I find it by accident?
Thanks and happy sunday
I am trying to find out where is the deleteaction property of the relations.
To find out if delete == cascade is ok:
Code: Select all
((EntityAssociation) relationProperty.Association).DeleteCascaded
So let say that for the relations Many-To-1 it is enough to know if we can delete the entity or not.
But to find out if a relation Many-To-0or1 is set to "Restrict" or "Cascade" or "None" I have no idea how, it is stored in the foreign key properties but how to access the foreign key from "EntityAssociation" or "EntityRelationProperty" (or anything else why not because it is not documented) is a mystery.
Would you please be so kind to share this information?
Or really do I have to try any methods like getextendedproperties() and then try to cast the object to everything until I find it by accident?
Thanks and happy sunday