Exemple #1
0
        public async Task <ActionResult> Delete(int roleId)
        {
            try
            {
                if (!_supervisor.RoleExists(roleId))
                {
                    return(NotFound());
                }

                if (!await _supervisor.DeleteRoleAsync(roleId))
                {
                    return(StatusCode(StatusCodes.Status500InternalServerError, "Error in remove Role"));
                }

                return(NoContent());
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Exception: ");
                return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
            }
        }