Пример #1
0
        public async Task <IActionResult> UpdateBank(Guid id, [FromBody] BankCreateRequestModel bank)
        {
            if (bank == null)
            {
                return(BadRequest());
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var bankExists = await _bankService.ExistsAsync(id);

            if (!bankExists)
            {
                return(GetNotFound());
            }


            var bankDto = Mapper.Map <BankCreateModel>(bank);
            await _bankService.UpdateAsync(id, bankDto);

            return(NoContent());
        }