public async Task <IHttpActionResult> GetAllByName(string name) { try { var reportDtos = await _reportService.GetAllByNameAsync(name, Search.StringOption.Contains); if (!reportDtos.Any()) { return(NotFound()); } var report = _mapper.Map <List <Report> >(reportDtos); return(Ok(report)); } catch (InvalidOperationException ioe) { return(InternalServerError(ioe)); } }