I’m having a problem regarding Entity Framework. I’ve to entities: Projects and Categories.
A category has multiple projects and a project has just 1 category.
Now, what I want is when I delete a category all projects with that category are set to null (so the category reference). I enabled the cascade in my edmx file, but it’s not working at all..
What am I missing out on?
This feature is not available in EF Designer. You must configure this behavior in your DBMS.
EF only supports CASCADE DELETE or PREVENT DELETE behaviors on designer.
Also, be aware that navigation properties to a deleted Category will return null, and may throw exceptions.