efcore
efcore copied to clipboard
Support Contains with a collection of tuples (e.g. for filtering on composite keys)
Currently, the only supported method for using a "Contains" statement on a composite key in EFCore 2.1 is to use a tuple and it is evaluated client-side. EF Core should be able to translate it to SQL.
For example:
return DbContext.PurchaseOrders
.Where(po => myKeys.Contains(new Tuple<string, int>(po.KeyPart1, po.KeyPart2)))
.ToList();
Could this be added to the backlog?