You aren’t deleting the object with the remove statement. Instead you are attempting to alter a record and make it an orphan (by setting the foreign key to null). The database has a non-null constraint on that column and prevents you from doing so.
More Related Contents:
- Convert String to Int in EF 4.0
- Entity Framework: There is already an open DataReader associated with this Command
- Linq: adding conditions to the where clause conditionally
- Entity framework linq query Include() multiple children entities
- How to filter nested collection Entity Framework objects?
- LINQ to Entities does not recognize the method ‘System.String Format(System.String, System.Object, System.Object)’
- Only initializers, entity members, and entity navigation properties are supported
- Entity Framework/Linq EXpression converting from string to int
- LEFT JOIN in LINQ to entities?
- The result of a query cannot be enumerated more than once
- Linq-to-entities – Include() method not loading
- Entity Framework – “Unable to create a constant value of type ‘Closure type’…” error
- Instantiating a context in LINQ to Entities
- conditional include in linq to entities?
- Linq To Entities – how to filter on child entities
- Creating dynamic queries with entity framework
- The specified type member ‘Date’ is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties
- Entity Framework 4 Single() vs First() vs FirstOrDefault()
- Entity Framework, Code First and Full Text Search
- LINQ OrderBy not ordering .. changing nothing .. why?
- Simple Linq query has duplicated join against same table?
- How to implement Unit of Work that works with EF and NHibernate
- What are the benefits of a Deferred Execution in LINQ?
- LINQ recursion function?
- LINQ: Dot Notation vs Query Expression
- Learning about LINQ [closed]
- How do I use structural annotations to set SQL type to Date in model first approach
- Does Entity Framework 4 Code First have support for identity generators like NHibernate?
- LINQ to Entities does not recognize the method ‘System.Web.Mvc.FileResult’
- Upgrade EF 4 EDMX to EF 6