Exemplo n.º 1
0
        public async Task <IActionResult> DeleteRole([FromBody] RoleDto dto)
        {
            if (!await _accountBl.RoleExistsAsync(dto.Role))
            {
                return(BadRequest($"Role \"{dto.Role}\" doesn`t exist"));
            }
            var role = await _accountBl.FindRoleByNameAsync(dto.Role);

            await _accountBl.DeleteRoleAsync(role);

            return(Ok($"Role \"{dto.Role}\" successfully removed away from this project"));
        }