예제 #1
0
 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));
     }
 }
예제 #2
0
 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));
     }
 }