Is it possible to make a query on two differents properties in a Where()? For exemple, I want to fetch all my users that have “Robert G” in their FirstName ans LastName properties. If I do :
var contacts = _session.All<Contact>()
.Where(x => x.IsActive
&& (x.FirstName.ToLower().Contains(q.ToLower())
|| x.LastName.ToLower().Contains(q.ToLower())));
I will get no result for “Robert G” since FirstName contains “Robert” and LastName “Gambonni”.
I also thought about making a new property FullName wich is only a Getter but then I have to load them all before since my property is not in the DB.
Any suggestions? Thanks a lot!
How about: