I have a table with a composite key eg:
modelBuilder.Entity<MyEntity>().HasKey(e=> new { e.Part1, e.Part2 });
I also have a list of keys in memory for which I want to load entities eg:
var keys = new [] { new { Part1= 1, Part2 = 2}, new { Part1= 3, Part2 = 4} }
How can I do a single query to load the entities in the keys array?
I've tried obvious things like ctx.MyEntities.Where(e => keys.Any(k => k.Part1 == e.Part1 && k.Part2 == e.Part2))
This answer suggests it isn't possible but surely this cant be the case.