public IActionResult Search(string name) { if (name.Length > 3) { try { return(Ok(_repository.SearchPersonsByName(name).OrderBy(p => p.Firstname))); } catch (Exception e) { //_logger.LogError($"Failed to get all trips: {e}"); return(BadRequest($"Error occured: {e}")); } } else { return(BadRequest("Minimum length of search query is 4 characters")); } }