I\'m trying to migrate old project from Linq2Sql to EF6 and I got following issue.
This project is multilingual (i.e. all texts have more than 1 translation) and I h
Note that it is not currently possible to filter which related entities are loaded. Include will always bring in all related entities.
Msdn Reference
var result = dc.ExampleEntity1.Include(ee =>ee.TextEntry.LocalizedContents)
.Select(x=>new
{
//Try anonymous or a projection to your model.
//As this Select is IQuerable Extension it will execute in the data store and only retrieve filtered data.
exampleEntity = x,
localizedContetnt = x.TextEntry.LocalizedContents.Where(g=>g.Id==YourKey),
}).FirstOrDefault();
You could try anonymous projection to filter contents in the Included entities
Entity framework team is working on this you could cast your vote here
Similar Answer