public async Task <MessageModel <string> > DeleteUser(string Ids) { var list = JsonConvert.DeserializeObject <List <Guid> >(Ids); var data = new MessageModel <string>(); data.success = await _userserver.DeleteUser(list); if (data.success) { data.msg = "删除成功"; } return(data); }
public ActionResult UserDelete(Guid id) { UserEntity entity = _userService.GetUserById(id); if (entity == null) { return(View("Error")); } _userService.DeleteUser(entity); return(RedirectToAction("UserList")); }
public async Task <MessageModel <string> > DeleteUser(string Ids) { var list = JsonConvert.DeserializeObject <List <Guid> >(Ids); var data = new MessageModel <string>(); try { data.success = await _userserver.DeleteUser(list); if (data.success) { data.msg = "删除成功"; } return(data); } catch (Exception ex) { data.success = false; data.msg = "删除失败!" + ex.Message; return(data); } }