// // GET: /Administration/Details/5 public ActionResult Details(int id = 0) { ChirpRepositoryService service = new ChirpRepositoryService(_chirpRepository); Chirp chirp = service.GetChirp(id); if (chirp == null) { return HttpNotFound(); } return View(chirp); }
public ActionResult Create(Chirp chirp) { if (ModelState.IsValid) { ChirpRepositoryService service = new ChirpRepositoryService(_chirpRepository); service.AddChirp(chirp); return RedirectToAction("Index", "Home"); } return View(chirp); }
// // GET: /Administration/ public ActionResult Index() { ChirpRepositoryService service = new ChirpRepositoryService(_chirpRepository); return View(service.GetAllChirps()); }
public ActionResult DeleteConfirmed(int id) { ChirpRepositoryService service = new ChirpRepositoryService(_chirpRepository); service.DeleteChirp(id); return RedirectToAction("Index", "Home"); }