public async Task <IActionResult> Edit(long id, [Bind("Id,Code,Name,Name2,Part001Name,Part001Name2,Active,Base")] Currency currency)
        {
            if (id != currency.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                if (!await _currenciesService.UpdateAsync(currency))
                {
                    return(NotFound());
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(currency));
        }
        public async Task <ErrorCodeResponse <CurrenciesErrorCodesContract> > UpdateAsync(
            [FromRoute][Required] string id, [FromBody] UpdateCurrencyRequest request)
        {
            var currency = _convertService.Convert <UpdateCurrencyRequest, Currency>(request);

            currency.Id = id;

            var correlationId = this.TryGetCorrelationId();

            var result = await _currenciesService.UpdateAsync(currency, request.UserName, correlationId);

            var response = new ErrorCodeResponse <CurrenciesErrorCodesContract>();

            if (result.IsFailed)
            {
                response.ErrorCode =
                    _convertService.Convert <CurrenciesErrorCodes, CurrenciesErrorCodesContract>(result.Error.Value);
            }

            return(response);
        }