public void Create(Church entity) { if (entity != null) { _repository.Insert(entity); } }
public ActionResult ChapterCreate(ChurchViewModel model) { if (ModelState.IsValid) { var mo = new Church { Name = model.Name, GroupId = model.GroupId, DefaultCurrencyId = model.DefaultCurrencyId, }; _stagedChurchService.Delete(model.Id); _churchService.Create(mo); this.AccessContext.FlushChanges(); mo.UniqueId = "C" + mo.Id; return Json(new { }); } ModelState.AddModelError("", "There are validation Errors"); return PartialView(model); }