-
Notifications
You must be signed in to change notification settings - Fork 60
EFCore 5: Compile Error when Using OnDelete Cascade #243
Comments
Thanks for pointing that out. The test case you show is a bit of an edge condition, and didn't have good coverage in the test model. |
Thanks for the quick reply, Michael! In the example above setting But I just tried with a non-required relationship where the Thanks |
Since it was manually changed, the T4 picks that up and generates the code for the cascade command, albeit in the wrong place currently. There's no check to see if it's the same as the default in this case. |
Not sure if that would be possible, but I think it would be a great feature if the designer what show somehow (e. g. by adding a |
Possible, yes, but lots of trouble. The default depends on the cardinalities (multiplicities) of the association, and changing the choices in a property editor isn't something done ad hoc. While it would be a nicety, when you consider development and testing effort, it's more trouble than it's worth. |
I see, yeah, although it would be a nice feature (to keep the model as simple as possible by "informing" the user when he sets a property which is default this way anyway), but if that's a big hazzle to implement, it's probably not worth the effort indeed. By the way, I tried your new build in the |
Released in 3.0.1 |
Thanks, Michael, tested and works well for me now! |
Hello Michael,
unfortunately, with your last update v3.0, probably due to fixing issue #240, it not even builds anymore.
Here another sample project:
EFDesignerCoreTest.zip
When using the
OnDelete
Cascade
option you now get a compiler error:modelBuilder.Entity<global::EFDesignerCoreTest.Entity1>().Navigation(e => e.EntityImplementation).OnDelete(DeleteBehavior.Cascade);
Best regards
Andreas
The text was updated successfully, but these errors were encountered: