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
NOT tested AND not perfect in terms of performance due to how include works... I would do it manually but here is an example of what you could do.
var result = dc.ExampleEntity1
.Include(x => x.TextEntry)
.Include(x => x.TextEntry.LocalizedContents)
.Include(x => x.TextEntry.LocalizedContents.Local)
.Where(x => x.id == 'ExampleEntity1Key'
&& x.TextEntity.LocalContent.Local.Id == 'Value'
)
.FirstOrDefault();
This would end up with an object of ExampleEntity1 with all navigation eager loaded.... where Local is matched on an id.
you could then get the Local like..
var listLocalsForExampleEnitity = result.TextEntry.LocalizedContents.Local.ToList();
or just call them from where ever as they are already in mem.
Hope this helps