public IActionResult Del(int id) { try { //return Ok(_repository.Delete(p => p.Id == id)); int count = _repository.Delete(p => p.Id == id); return(Json(new { count, state = "0", msg = "操作成功!" })); } catch (Exception ex) { return(Json(new { state = "-1", msg = "非法操作!" })); } }