EF how to map database foreign key constraints in detail?

I want to use the flunt API configuration in the foreign key relationship when performing the delete operation, set the value to null, like this. .

Started by Larry at February 06, 2016 - 6:01 PM

You do so is a violation of the rules, since you have already set up a foreign key relationship, you want to remove the foreign key, you must use the foreign key is set to null, then delete.

Posted by Rudolf at November 10, 2016 - 1:56 PM

Flunt API the default is treated in the same way, do not need special settings

Posted by Arlen at November 21, 2016 - 2:02 PM

No, now delete the table will be constrained.

Posted by Larry at November 22, 2016 - 2:08 PM

To delete from the list, then delete constraints.

Posted by Alan at December 05, 2016 - 2:36 PM

I'm in the OnModelCreating method of the EF, delete rule "foreign key relationship is set to null"

I know the default is the design of cascaded and cancel the cascade method, I do not want this, I want is set to null.

Posted by Larry at December 17, 2016 - 2:53 PM

Cannot delete in the business layer.

Posted by Larry at January 01, 2017 - 3:20 PM

If not hard deleted, it can only cancel the foreign key constraint definition, through SQL code to control logic

Posted by York at January 02, 2017 - 3:59 PM

Through the SQL to define a method, but the feeling is not the best, do not know whether the flunt API provide the method removes regular value is set to "set to null". You can now set to cancel the cascade and cascade. But the main table delete when there will be a constraint, or can not be deleted.

Posted by Larry at January 08, 2017 - 5:46 PM

What is the main table constraint? If nothing else reference table, should not be a problem.

Posted by York at January 09, 2017 - 4:38 PM

The response to 2013-10-13 09:06:49 was removed by the administrator

Posted by Emerald at January 10, 2017 - 5:35 PM

What is the "best of the best"?

To care about what is "more appropriate". You know, any concrete conclusions are that one day out of date.

Posted by Judith at January 12, 2017 - 5:28 PM