public async Task <IActionResult> GetAsync(int transactionId)
        {
            _logger.LogInformation($"{nameof(TransactionsController)}: {nameof(GetAsync)} was called for {transactionId}.");

            var transactionDomainModel = await _transactionsService.GetTransaction(transactionId, _currentUserService.AccessKey);

            if (transactionDomainModel == null)
            {
                return(NotFound(transactionId));
            }

            var transactionDto = _mapper.Map <TransactionDto>(transactionDomainModel);

            if (_mediaTypeService.IsLinkedRepresentation(_mediaType))
            {
                var linkedTransactionDto = new LinkedTransactionDto
                {
                    Transaction = transactionDto,
                    Links       = CreateLinksForTransaction(transactionId)
                };

                return(Ok(linkedTransactionDto));
            }
            else
            {
                return(Ok(transactionDto));
            }
        }
        public async Task <IActionResult> CreateAsync(TransactionInputDto inputModel)
        {
            _logger.LogInformation($"{nameof(TransactionsController)}: {nameof(CreateAsync)} was called.");

            var transactionDomainModel = _mapper.Map <TransactionDomainModel>(inputModel);

            var modelState = _transactionsService.ValidateTransaction(transactionDomainModel);

            if (!modelState.IsValid)
            {
                return(UnprocessableEntity(modelState));
            }

            transactionDomainModel.AccessKey = _currentUserService.AccessKey;

            transactionDomainModel = await _transactionsService.CreateTransaction(transactionDomainModel);

            var transactionDto = _mapper.Map <TransactionDto>(transactionDomainModel);

            if (_mediaTypeService.IsLinkedRepresentation(_mediaType))
            {
                var linkedTransactionDto = new LinkedTransactionDto
                {
                    Transaction = transactionDto,
                    Links       = CreateLinksForTransaction(transactionDto.TransactionId)
                };

                return(CreatedAtAction(
                           nameof(GetAsync),
                           new { transactionId = transactionDto.TransactionId },
                           transactionDto));
            }
            else
            {
                return(CreatedAtAction(
                           nameof(GetAsync),
                           new { transactionId = transactionDto.TransactionId },
                           transactionDto));
            }
        }