예제 #1
0
        public async Task <ServiceResponse <RoleDto> > AddRole(RoleDtoAdd newRole)
        {
            try
            {
                var data = await Post <RoleDtoAdd, Role, RoleDto>(newRole);

                return(ResponseResult.Success(data));
            }
            catch (Exception ex)
            {
                return(ResponseResult.Failure <RoleDto>($"Bad Request : {ex.Message}"));
            }
        }
예제 #2
0
        public async Task <IActionResult> UpdateRole(string id, RoleDtoAdd newRole)
        {
            var result = await _auth.UpdateRole(id, newRole);

            return(Ok(result));
        }
예제 #3
0
        public async Task <IActionResult> AddRole(RoleDtoAdd newRole)
        {
            var result = await _auth.AddRole(newRole);

            return(Ok(result));
        }