public async Task <IActionResult> SearchByWord([FromRoute] string word) { var query = new SearchByWord(word); var result = await _mediator.Send(query); return(Ok(result)); }
public IEnumerable <LotView> FindByWord(SearchByWord word) { try { var mapper = new MapperConfiguration(cfg => cfg.CreateMap <LotDTO, LotView>()).CreateMapper(); IEnumerable <LotDTO> lots = service.FindByWord(word.Word); return(mapper.Map <IEnumerable <LotDTO>, IEnumerable <LotView> >(lots)); } catch (Exception e) { return(null); } }