msawczyn/EFDesigner

Cascade Delete colouring

alprinias opened this issue · 4 comments

Hi Michael,
It looks like an older (and fixed) bug has made its way back into the code. The OnDelete Cascade associations do not show up in red anymore, no matter whether they were explicitly declared as such (Cascade) or were decided to be such by the EntityFramework according to the cardinalities (Default). This happens when the global property "Show Cascade Deletes" is set to True and using the 3.0.4.7 version of the designer. If this helps, the earlier issue reporting the same was #108

By the way, I think it would be a great enhancement, if one could decide with a global setting what the default OnDelete behaviour should be. And then change explicitly only the desired ones.

Best regards,
Alex

OnDelete behavior is largely dictated by the type of association you've created, enforced by Entity Framework. For instance, if you have a 1-0/1 or 1-N association, deleting the "1" side causes a cascade delete of the other side ... nothing you can do about that. It's when the association is optional that you have a choice.

I think it would cause a lot of confusion and bad behavior to be able to override that (for optional ends) at a global level. Overriding is really a case-by-case thing, and the designer allows that when it's a safe thing to do.

I'll need to take a look at the coloring problem. Thanks for the report.

Looking back at #108 and the commits that led to it being closed, I'm thinking more and more like this is a brittle and problematic feature that just needs to be taken out of the designer. It's becoming quite a time sink for little return. I'm going to give it a few more goes and then, if it doesn't resolve, just yank it.

Released in v3.0.7