public ActionResult Edit(Guid id) { CommonMenuInfo entity = CommonMenuInfoService.GetModel(id); var model = Mapper.Map <CommonMenuInfoDTO>(entity); return(View(model)); }
/// <summary> /// 修改 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Modify(CommonMenuInfo entity) { using (var context = new DbContext()) { context.CommonMenuInfoContext.Update(entity); return(context.SaveChanges() > 0); } }
/// <summary> /// 新增 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Add(CommonMenuInfo entity) { using (var context = new DbContext()) { context.CommonMenuInfoContext.Add(entity); return(context.SaveChanges() > 0); } }