The relationship could not be changed because one or more of the foreign-key properties is non-nullable in MVC 4

asp.net-mvc entity-framework

Accepted Answer

ZZZ_tmp
14
5/15/2014 9:11:29 AM

Popular Answer

This issue can be resolved in a simpler way.
Actually, the reason for this is your one-to-many relationship. There are two options available when you want to delete One Side: cascade delete or none.
When you choose the first option, all the numerous side entities will be deleted together with the one side. This setting is available in the entity diagram. Only the relationship must be chosen, and the "End1 OnDelete" attribute must be set to Cascade.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow