/// <summary> /// 添加或者编辑新闻 /// </summary> /// <param name="news">新闻</param> /// <returns>返回添加或保存结果</returns> public Response CreateOrUpdate(News news) { return this.InvokeService( nameof(CreateOrUpdate), () => { this.Persistence.Update(NS, "CreateOrUpdate", news); this.ClearCache<News>(); this.ClearCache<File>(); }, news); }
public ActionResult CreateOrUpdate(News news) { var rspFile = this.FileStorageClient.Upload(WebHelper.GetLogOnAccount(), this.Request); if (rspFile.IsSuccess) { news.PublisherId = WebHelper.GetLogOnUserId(); var rsp = this.NewsService.CreateOrUpdate(news); } return RedirectToAction("Index"); }