public void Delete_Test() { var model = _applicationDbContext.Types.First(); _typesRepository.Delete(model); Assert.IsFalse(_applicationDbContext.Types.Any(t => t.ID == model.ID)); }
public int Delete(int id) { try { var res = _typesRepo.Delete(id); return(res); } catch (Exception e) { throw e; } }
public void Delete(int id) { var type = _typesRepository.Get(id); if (type == null) { throw new ApplicationException("Błąd, brak encji"); } if (!_typesRepository.Delete(type)) { throw new ApplicationException("Błąd, blad zapisu"); } }
public ActionResult DeleteType(int id) { _typeRepository.Delete(id); return(RedirectToAction("GetAllTypes")); }
public void Delete(TypeEntity entity) { _repository.Delete(entity); }
public IActionResult DeleteConfirmed(int id) { _repository.Delete(id); return(RedirectToAction(nameof(Index))); }