Esempio n. 1
0
        public async Task <JsonResponse> DeleteRole(int id)
        {
            var role = (await _roleServices.Query(p => p.Id == id)).SingleOrDefault();

            if (role == null)
            {
                throw new UserOperationException("角色不存在");
            }
            var dResult = _roleServices.DeleteById(id);

            if (dResult <= 0)
            {
                throw new UserOperationException("删除失败");
            }
            return(new JsonResponse(true));
        }