Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Cascade Delete colouring #291

Closed
alprinias opened this issue May 28, 2021 · 4 comments
Closed

Cascade Delete colouring #291

alprinias opened this issue May 28, 2021 · 4 comments
Labels
bug Confirmed bug released Issue is resolved in a current release
Milestone

Comments

@alprinias
Copy link

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

@msawczyn msawczyn added the investigating Looking into this label May 31, 2021
@msawczyn
Copy link
Owner

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.

@msawczyn msawczyn added the bug Confirmed bug label May 31, 2021
@msawczyn msawczyn removed the investigating Looking into this label Jun 2, 2021
@msawczyn
Copy link
Owner

msawczyn commented Jun 2, 2021

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.

@alprinias
Copy link
Author

alprinias commented Jun 2, 2021 via email

@msawczyn msawczyn added the pending release Issue is resolved in the current codebase, will be published with the next release label Jun 5, 2021
@msawczyn msawczyn added this to the 3.0.7 milestone Jun 5, 2021
msawczyn added a commit that referenced this issue Jul 9, 2021
   - Fixed a number of issues with importing compiled assemblies
   - Fixed coloring of cascade delete associations when flagged on the model (see #291)
   - Fixed missing '$' in generator template that was generating bad code for table schemas (see #289)
   - Restored auto-instantiation of dependent objects in entity constructors (see #287)
   - Added Microsoft.VisualStudio.Modeling.Components.15.0.dll to DslPackage assembly (see #293)
@msawczyn msawczyn added released Issue is resolved in a current release and removed pending release Issue is resolved in the current codebase, will be published with the next release labels Oct 10, 2021
@msawczyn
Copy link
Owner

Released in v3.0.7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Confirmed bug released Issue is resolved in a current release
Projects
None yet
Development

No branches or pull requests

2 participants