public async Task <IResult> DeleteAsync(ForeignIndividualCurrentCardDeleteDto foreignIndividualCurrentCardDeleteDto)
        {
            var forDelete = await this.GetByIdAsync(foreignIndividualCurrentCardDeleteDto.Id);

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

            var result = await _foreignIndividualCurrentCardDal.HardDeleteAsync(forDelete.Data);

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

            return(new SuccessResult(Messages.ForeignIndividualCurrentCardDeleted));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> HardDeleteAsync(ForeignIndividualCurrentCardDeleteDto foreignIndividualCurrentCardDeleteDto)
        {
            var result = await _foreignIndividualCurrentCardService.DeleteAsync(foreignIndividualCurrentCardDeleteDto);

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