Exemplo n.º 1
0
        public async Task <IActionResult> AddRole([FromBody] RoleDto dto)
        {
            if (await _accountBl.RoleExistsAsync(dto.Role))
            {
                return(BadRequest($"Role \"{dto.Role}\" already exist"));
            }
            await _accountBl.CreateRoleAsync(new IdentityRole(dto.Role));

            return(Ok($"Role \"{dto.Role}\" successfully added"));
        }