Esempio n. 1
0
        public async Task <ActionResult <IEnumerable <Currency> > > GetCurrency()
        {
            ResponseDTO <CurrencyDTO> response = new ResponseDTO <CurrencyDTO>();
            ListDTO <CurrencyDTO>     list     = new ListDTO <CurrencyDTO>();

            list          = _currenciesManager.GetAllCurrencies();
            response.Data = new ListDTO <CurrencyDTO>();
            if (list != null)
            {
                response.Data    = list;
                response.Message = "List is retrieved successfully";
                response.Success = true;
                return(Ok(response));
            }
            response.Data    = null;
            response.Message = "List is not retrieved successfully";
            response.Success = false;

            return(NotFound(response));
        }
Esempio n. 2
0
        public async Task <ActionResult <IEnumerable <Currency> > > GetCurrency()
        {
            var currencyList = _currenciesManager.GetAllCurrencies();

            return(Ok(_mapper.Map <IEnumerable <CurrencyDTO> >(currencyList)));
        }