Exemple #1
0
        public IActionResult Update(int id, UpdateSpecialtyDTO updateSpecialtyDTO)
        {
            if (ModelState.IsValid == false)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                _specialtyAppService.Update(updateSpecialtyDTO);

                _generalAppService.CommitTransaction();
                return(NoContent());
            }
            catch (Exception ex)
            {
                _generalAppService.RollbackTransaction();

                return(BadRequest(ex.Message));
            }
        }