public IActionResult EditAbility([FromBody] AbilitiesDto ability, string name) { try { _services.EditAbilities(_mapper.Map <Abilities>(ability), name); return(Ok(ability)); } catch (BadRequestException ex) { return(BadRequest(ex.Message)); } catch (NotFoundException ex) { return(NotFound(ex.Message)); } catch (BusinessException ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }
public IActionResult CreateAbility([FromBody] AbilitiesDto ability) { try { _services.InsertAbilities(_mapper.Map <Abilities>(ability)); return(Created("", ability)); } catch (BadRequestException ex) { return(BadRequest(ex.Message)); } catch (AlreadyExistException ex) { return(BadRequest(ex.Message)); } catch (BusinessException ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }