Exemplo n.º 1
0
        public async Task <ActionResult <ExpenseDto> > GetExpenseAsync(Guid id)
        {
            var expense = await _expensesRepository.GetExpenseAsync(id);

            if (expense is null)
            {
                return(NotFound());
            }

            return(Ok(expense.AsDto()));
        }
        public async Task <ActionResult <ExpenseDto> > GetExpenseAsync(Guid id)
        {
            var expense = await repository.GetExpenseAsync(id);

            if (expense is null)
            {
                return(NotFound());
            }

            logger.LogInformation($"{DateTime.UtcNow.ToString("hh:mm:ss")}: Retrieved Category: {expense.AsDto().Category}: Retrieved Price: {expense.AsDto().Price}");

            return(Ok(expense.AsDto()));
        }