public async Task <IResult> UpdateAsync(ForeignIndividualCurrentCardUpdateDto foreignIndividualCurrentCardUpdateDto)
        {
            var forUpdate = await this.GetByIdAsync(foreignIndividualCurrentCardUpdateDto.Id);

            if (!forUpdate.Success)
            {
                return(forUpdate);
            }

            var mappedEntity = _mapper.Map(foreignIndividualCurrentCardUpdateDto, forUpdate.Data);

            var result = await _foreignIndividualCurrentCardDal.UpdateAsync(mappedEntity);

            if (!result)
            {
                return(new ErrorResult(Messages.ForeignIndividualCurrentCardNotUpdated));
            }

            return(new SuccessResult(Messages.ForeignIndividualCurrentCardUpdated));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> UpdateAsync(ForeignIndividualCurrentCardUpdateDto foreignIndividualCurrentCardUpdateDto)
        {
            var result = await _foreignIndividualCurrentCardService.UpdateAsync(foreignIndividualCurrentCardUpdateDto);

            return(result.Success == false?BadRequest(result) : Ok(result));
        }