Пример #1
0
        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));
        }
Пример #2
0
        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}"));
            }
        }
Пример #3
0
 public List <Seller> FindAll()
 {
     return(sellerRepository.FindAll());
 }