Пример #1
0
        /// <summary>
        /// Handling the "create" event of a commodity configuration
        /// </summary>
        /// <param name="request">The command object that contains all the properties to create commodities and related objects.</param>
        /// <param name="cancellationToken">Token to cancel the operation.</param>
        public async Task <Unit> Handle(FxTradeTypeCreateCommands request, CancellationToken cancellationToken)
        {
            _unitOfWork.BeginTransaction();

            try
            {
                // await _fxTradeTypeRepository.CreateArbitration(request.MasterDataList);

                _logger.LogInformation("Fx Trade Type created.");

                _unitOfWork.Commit();

                return(Unit.Value);
            }
            catch
            {
                _logger.LogInformation("Fx Trade Type create failed.");
                _unitOfWork.Rollback();
                throw;
            }
        }
Пример #2
0
        public async Task <IActionResult> Create(string company, [FromBody, Required] FxTradeTypeCreateCommands request)
        {
            await _mediator.Send(request);

            return(NoContent());
        }