/// <summary> /// 更新 ///</summary> /// <param name="obj"></param> public void Update(NewsFormDTO obj) { Repository.Update(u => u.Id == obj.Id, u => new News { Name = obj.Name, Content = obj.Content, IsPublish = obj.IsPublish, }); }
public JsonResult Update(NewsFormDTO model) { try { _app.Update(model); } catch (Exception ex) { Result.Code = 500; Result.Message = ex.InnerException?.Message ?? ex.Message; } return(Json(Result)); }