Using EntityFramework 4. I have an
EntityCollection<SomeEntity> currentEntities with ~500k entities and a
List<SomeEntity> importedEntities also with ~500k records. I want to have the list of all records occuring in
currentEntities which don't exist in
currentEntities.Select(x => x.ID).Except(importedEntities.Select(x => x.ID)) to get unique IDs of occurring records causes a
System.OutOfMemoryException because it apparently loads all of the entities into the memory.
currentEntities.Where(x => !importedEntities.Any(y => y.ID == x.ID)) fails with
NotSupportedException ("Only primitive types ('such as Int32, String, and Guid') are supported in this context").
Is this even possible in L2E ?
Share Your Comment :)Related Questions:
- How to determine if Navigation Property in the Entity Framework is set without loading the related records
- In Linq to EF 4.0, I want to return rows matching a list or all rows if the list is empty. How do I do this in an elegant way?
- with the database table id column"'>What's the best way to compare a list
with the database table id column
Label: [c#] [entity-framework] [linq-to-entities] [outofmemoryexception]