Multi string search

JROW 21 Reputation points
2021-07-07T08:44:02.937+00:00

Hey All,

I have a datatable, of which I am doing all of the functionality on the server side. However, I am a little stuck as to how to search for two strings from separate columns.

For example John Smith should bring up all john smiths in the table, below is a snippet of my search function

  archiveData = archiveData.Where(m => m.Forename.Contains(searchValue.ToLower())
                                                || m.Surname.Contains(searchValue.ToLower())
                                                || m.Patient_Id.Contains(searchValue)
                                                || m.Request_Date.ToString().Contains(searchValue));

I understand that I need to split the string at the space at the end of the forename column then join on to the surname somehow but im a little stuck. Im still getting to grips with c#

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,612 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.