Exemplo n.º 1
0
        public async Task <IActionResult> SearchByWord([FromRoute] string word)
        {
            var query  = new SearchByWord(word);
            var result = await _mediator.Send(query);

            return(Ok(result));
        }
Exemplo n.º 2
0
 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);
     }
 }