public async Task <ActionResult> Update(FastShare model) { var b = await FastShareService.GetQuery(s => s.Id == model.Id).UpdateFromQueryAsync(s => new FastShare() { Title = model.Title, Link = model.Link, Sort = model.Sort }) > 0; return(ResultData(null, b, b ? "更新成功" : "更新失败")); }
public ActionResult Update(FastShare model) { FastShare share = FastShareService.GetById(model.Id); share.Title = model.Title; share.Link = model.Link; share.Sort = model.Sort; bool b = FastShareService.UpdateEntitySaved(share); return(ResultData(null, b, b ? "更新成功" : "更新失败")); }
public async Task <ActionResult> Update(FastShare model) { FastShare share = await FastShareService.GetByIdAsync(model.Id); share.Title = model.Title; share.Link = model.Link; share.Sort = model.Sort; bool b = await FastShareService.SaveChangesAsync() > 0; return(ResultData(null, b, b ? "更新成功" : "更新失败")); }
public ActionResult Add(FastShare share) { bool b = FastShareService.AddEntitySaved(share) != null; return(ResultData(null, b, b ? "添加成功" : "添加失败")); }