I want query on two field with multiple data via EntityFramework on Student entity. I want all students that name and family exist in filters together. I excepted that record 9 and 6 return in result with one query. how do this operation.
Data in db is:
Id Name Family
-------------------------------
1 John Cooper
2 Lee Chang
3 Morgan Freeman
4 Luis Enrique
5 Jack Anderson
6 Adam Freeman
7 Bill Gates
8 David Beckham
9 Luis Figo
Filters is:
var filters = new List<NameFamily>
{
new NameFamily{Name = "Adam", Family = "Freeman"},
new NameFamily{Name = "Luis", Family = "Figo"},
};
Classes is following:
public class Student
{
public int Id{get; set;}
public string Name{get; set;}
public string Family{get; set;}
}
public class NameFamilyDto
{
public string Name{get; set;}
public string Family{get; set;}
}