// Use the RunAsync set of methods to run ESAPI-related actions on a separate thread public Task <PatientMatch[]> SearchAsync(string searchText) => RunAsync(() => _search.FindMatches(searchText) .Select(ps => new PatientMatch { Id = ps.Id, FirstName = ps.FirstName, LastName = ps.LastName }) .ToArray());
public PatientMatch[] FindPatientMatches(string searchText) => _search.FindMatches(searchText).Select(CreatePatientMatch).ToArray();