public void Delete() { if (_selectedItem != null) { GlossaryRepository.Delete(SelectedItem); Items = GlossaryRepository.Items; } else { MessageBox.Show("No item selected", "Notice"); } }
public ActionResult Delete(int id, IFormCollection collection) { try { // TODO: Add delete logic here GlossaryItem item = new GlossaryItem(); item.Id = id; _repos.Delete(item); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }