public ActionResult SaveDefaultSetting(Setting setting) { if (setting.Id == null || setting.Id == Guid.Empty) { var newItem = settingService.Add(setting); return Json(new JsonData() { Data = newItem, Success = true }, JsonRequestBehavior.AllowGet); } else { var update = settingService.Update(setting); return Json(new JsonData() { Data = update, Success = true }, JsonRequestBehavior.AllowGet); } }
public Setting Update(Setting packageItem) { var updateItem = settingRepository.Update(packageItem); return updateItem; }
public Setting Add(Setting packageItem) { packageItem.Id = Guid.NewGuid(); var newItem = settingRepository.Add(packageItem); return newItem; }