I am trying to get this LINQ query to return exact matches if they exist or the "startswith" result if not. Right now it returns both.
example
SearchParam = "mundt" Results = Mundt, Mark | Mundt, Chris | Mundth, Lori
public static DataTable SearchPerson(string SearhParam)
{
var context = new ConnectDataContext(Properties.Settings.Default.ConnectConnectionString);
var myQuery = (from person in context.tblPersons
where person.LastName.StartsWith(SearhParam) || person.LastName == SearhParam
orderby person.LastName
select new { person.PersonID, person.LastName, person.FirstName, person.SSN });
var dataTable = myQuery.CopyLinqToDataTable();
return dataTable;
}