public ActionResult DeleteConfirmed(long id) { UniversesPost universes = _universesService.GetPost(id); universes.UserName = User.Identity.Name; _universesService.Delete(universes); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind("ixUniverse,sUniverse")] UniversesPost universes) { if (ModelState.IsValid) { universes.UserName = User.Identity.Name; _universesService.Edit(universes); return(RedirectToAction("Index")); } return(View(universes)); }
public ActionResult Edit(long id) { UniversesPost universes = _universesService.GetPost(id); if (universes == null) { return(NotFound()); } return(View(universes)); }
public Task Delete(UniversesPost universesPost) { // Additional validations // Pre-process // Process this._universesRepository.RegisterDelete(universesPost); try { this._universesRepository.Commit(); } catch (Exception ex) { this._universesRepository.Rollback(); // Log exception throw; } // Post-process return(Task.CompletedTask); }
public Task <Int64> Create(UniversesPost universesPost) { // Additional validations // Pre-process // Process this._universesRepository.RegisterCreate(universesPost); try { this._universesRepository.Commit(); } catch (Exception ex) { this._universesRepository.Rollback(); // Log exception throw; } // Post-process return(Task.FromResult(universesPost.ixUniverse)); }
public void RegisterDelete(UniversesPost universesPost) { _context.UniversesPost.Remove(universesPost); }
public void RegisterEdit(UniversesPost universesPost) { _context.Entry(universesPost).State = EntityState.Modified; }
public void RegisterCreate(UniversesPost universesPost) { _context.UniversesPost.Add(universesPost); }