I’ve created a search controller for a name search and my code looks like this:
from a in _entities.MainContacts
where a.Firstname.Contains(qry) || a.Lastname.Contains(qry)
orderby a.Lastname
select a).ToList();
I would like to include a concatenate so that if someone puts in a fullname it will find it by looking at firstname & " " & Lastname I know how to create a field in sql, but not sure if its the same in mvc.
Any advice would be really gratefully received.
Cheers
ant
You can do this.
I will admit its not the best but it works and will produce sql statement like this.
I’ve only included the fullname check above.