When you hava an entiy with FirstName and LastName columns, and you need to filter by fullname, a quick solution is to filter by the fields value concatenation:
var agents = from a in DB.Agents
where a.FirstName.Contains(name) ||
a.LastName.Contains(name) ||
String.Concat(a.FirstName, " ", a.LastName).Contains(name)
select a;
var agents = from a in DB.Agents
where a.FirstName.Contains(name) ||
a.LastName.Contains(name) ||
String.Concat(a.FirstName, " ", a.LastName).Contains(name)
select a;
No comments:
Post a Comment