I got the answer. 🙂 Those cascade deletes were being created because of ManyToManyCascadeDeleteConvention
. You need to remove this convention to prevent it from creating cascade deletes for link tables:
modelBuilder.Conventions.Remove<ManyToManyCascadeDeleteConvention>();
More Related Contents:
- Decimal precision and scale in EF Code First
- Ignoring a class property in Entity Framework 4.1 Code First
- How can I automatically filter out soft deleted entities with Entity Framework?
- EF Code-First One-to-one relationship: Multiplicity is not valid in Role * in relationship
- How to compare only Date without Time in DateTime types in Linq to SQL with Entity Framework?
- How to compare only Date without Time in DateTime types?
- How to Specify Primary Key Name in EF-Code-First
- Entity Framework: Duplicate Records in Many-to-Many relationship
- How can set a default value constraint with Entity Framework 6 Code First?
- How do I apply OrderBy on an IQueryable using a string column name within a generic extension method?
- The cast to value type ‘Int32’ failed because the materialized value is null
- Bulk-deleting in LINQ to Entities
- EF Data Context – Async/Await & Multithreading
- Why would try/finally rather than a “using” statement help avoid a race condition?
- Retrieve an object from entityframework without ONE field
- DbContext discard changes without disposing
- EF4 Code First: how to add a relationship without adding a navigation property
- Entity Framework 4: How to find the primary key?
- How to COUNT rows within EntityFramework without loading contents?
- Max return value if empty query
- Group by with multiple columns using lambda
- Check if list contains item from other list in EntityFramework
- How to do an “in” query in entity framework?
- big issue in converting string to datetime using linq-to-entities
- Mixing Fluent API and DataAnnotations in EF code first
- Keep Getting ‘The LINQ expression node type ‘Invoke’ is not supported in LINQ to Entities’ Exception
- How to force LINQ Sum() to return 0 while source collection is empty
- How to include() nested child entity in linq
- Retrieve List of Tables in MS Access File
- LINQ Query to Convert string to datetime