public async Task <Response <string> > AddRoleAsync(AddRoleDto addRoleDto) { if (await _roleManager.GetRoleAsync(addRoleDto.Name) != null) { return(Response <string> .Fail("The role already exists. Please try a different one!")); } var appRole = _mapper.Map <ApplicationRole>(addRoleDto); var rs = await _roleManager.AddRoleAsync(appRole); return(rs.Succeeded ? Response <string> .Success(appRole.Id, "New role has been created") : Response <string> .Fail("Failed to create new role")); }