private void BtnDelete_Click(object sender, EventArgs e) { if (lstTypes.SelectedIndex > -1) { typeRepository.Delete(type); LoadListBox(); ClearTextBoxes(); } }
public IActionResult Delete([FromRoute] int id) { var type = typeRepository.FindById(id); if (type == null) { return(NotFound()); } typeRepository.Delete(id); return(NoContent()); }
public void Delete() { //Act repository.Delete(id); context.SaveChanges(); var result = repository.GetAll().ToList(); //Assert Assert.IsNotNull(result); Assert.AreEqual(2, result.Count); Assert.AreNotEqual(1, result[0].ID); }
private void deleteBtn_Click(object sender, EventArgs e) { TypeRepository typeRepo = new TypeRepository(); foreach (DataGridViewRow row in dataGridView1.SelectedRows) { int typeId = (int)row.Cells["Id"].Value; typeRepo.Delete(typeId); MessageBox.Show("Selected rows Deleted!"); } FormReLoad(); }
public void Delete(int ID) { tRep.Delete(x => x.ID == ID); }