public void Delete_Test()
        {
            var model = _applicationDbContext.Types.First();

            _typesRepository.Delete(model);

            Assert.IsFalse(_applicationDbContext.Types.Any(t => t.ID == model.ID));
        }
Example #2
0
 public int Delete(int id)
 {
     try
     {
         var res = _typesRepo.Delete(id);
         return(res);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #3
0
        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");
            }
        }
Example #4
0
        public ActionResult DeleteType(int id)
        {
            _typeRepository.Delete(id);

            return(RedirectToAction("GetAllTypes"));
        }
Example #5
0
 public void Delete(TypeEntity entity)
 {
     _repository.Delete(entity);
 }
 public IActionResult DeleteConfirmed(int id)
 {
     _repository.Delete(id);
     return(RedirectToAction(nameof(Index)));
 }