public async Task <IGenericResult> FindAll() { var result = await _sellerRepository.FindAll(); if (!result.Any()) { return(new GenericResult(true, "Não existem vendedores cadastrados no sistema.")); } return(new GenericResult(true, result)); }
public async Task <IActionResult> Getsellers() { var location = GetControllerActionNames(); try { _logger.LogInfo($"{location}: Attempted call"); var sellers = await _sellerRepository.FindAll(); var response = _mapper.Map <IList <SellerDTO> >(sellers); _logger.LogInfo($"{location}: Successfully"); return(Ok(response)); } catch (Exception e) { return(internalError($"{location}: {e.Message} - {e.InnerException}")); } }
public List <Seller> FindAll() { return(sellerRepository.FindAll()); }