I have a List of Foo, where Foo is:
public class Foo
{
public string Id { get; set; }
public string Name { get; set; }
}
and a database entity Bar:
public partial class Bar
{
public string Id { get; set; }
public string Name { get; set; }
public int Count { get; set; }
etc...
}
I want to get Bars where the Id and Name match a Foo in the List. Something like:
var records = databaseContext.Bar
.Where(r => FooList.Contains(*a Foo with Id and Name matching r.Id and r.Name*))
.ToArray()
How can I get these records in an efficient and clean way?