public ActionResult Delete(int id, FormCollection collection) { try { ChatVM.GetMeuteDeChats().Remove(ChatVM.GetMeuteDeChats().Where(c => c.Id == id).First()); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Chat/Delete/5 public ActionResult Delete(int id) { var chat = ChatVM.GetMeuteDeChats().Where(c => c.Id == id).FirstOrDefault(); return(View(chat)); }
// GET: Chat public ActionResult Index() { var listeDeChats = ChatVM.GetMeuteDeChats(); return(View(listeDeChats)); }