public ActionResult OnPost() { Id = Convert.ToInt32(Request.RouteValues["Id"]); if (ModelState.IsValid) { return(Page()); } #region 没有SQL操作修改 //_repository.GetSingle(Id).PublishTime = problem.PublishTime; //_repository.GetSingle(Id).Title = problem.Title; //_repository.GetSingle(Id).Abstact = problem.Abstact; #endregion //_repository.GetSingle(Id).Update(problem); //_repository.SaveChanges(); Problem.Id = Id; _repository.Update(Problem); return(RedirectToPage("/ProblemModel/Single", new { Id = Id })); }
public Problem Update(ProblemUpdateVM model) { _repo.Update(model); return(_repo.Get(model.Id)); }
/// <summary> /// 更新异常信息 /// </summary> /// <param name="dtos">包含更新信息的异常DTO信息</param> /// <returns>业务操作结果</returns> public OperationResult EditProblems(params ProblemDto[] dtos) { return(ProblemRepository.Update(dtos)); }