예제 #1
0
        public IHttpActionResult DeleteRole(int id)
        {
            Role role = _roleService.GetRole(id);

            if (role == null)
            {
                return(NotFound());
            }
            _roleService.DeleteRole(role);
            _roleService.SaveRole();

            return(Ok(role));
        }
예제 #2
0
        public DeleteRoleResponse Delete(DeleteRoleRequest request)
        {
            unitOfWork.BeginTransaction();
            var role = roleService.DeleteRole(request.Id, request.Data.Version, true);

            unitOfWork.Commit();

            // Notify.
            Events.UserEvents.Instance.OnRoleDeleted(role);

            return(new DeleteRoleResponse {
                Data = true
            });
        }