Ejemplo n.º 1
0
        public async Task <ResponseApi> Handle(DeleteAcademicFormationCommand request, CancellationToken cancellationToken)
        {
            try
            {
                AcademicFormation academicFormation = _mapper.Map <AcademicFormation>(await _academicFormationRepository.Get(request.IdAcademicFormation));

                await _academicFormationRepository.Delete(academicFormation);

                return(new ResponseApi(true, "Academic formation deleted sucessfuly", null));
            }
            catch (Exception e)
            {
                return(new ResponseApi(false, "Error...", e));
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> DeleteAcademicFormation([FromRoute] DeleteAcademicFormationCommand deleteFormation)
        {
            var result = await _mediator.Send(deleteFormation);

            return(Ok(result));
        }