public void DeleteTest() { var model = _applicationDbContext.Types.First(); _typesService.Delete(model.ID); Assert.IsFalse(_applicationDbContext.Types.Any(t => t.ID == model.ID)); }
public ActionResult Delete(int id) { try { _typesService.Delete(id); } catch { return(HttpNotFound()); } return(RedirectToAction("Index")); }
public int Delete(int TypeID) { try { int res = _TypesService.Delete(TypeID); return(res); } catch (Exception ex) { _logger.LogError(ex.Message); throw ex; } }