public ActionResult Delete(long id) { newRepository.Delete(new TinTuc() { NewID = id }); return(RedirectToAction("Index")); }
public void Delete(int id, long currentUserId) { try { var user = _newRepository.GetAll().FirstOrDefault(p => p.Id == id && p.UserId == currentUserId); if (user == null) { throw new ServiceException("You don`t have permissions to make this action!"); } _logger.Info("Start deleting article with id " + id); _newRepository.Delete(p => p.Id == id); _logger.Info("Delete Article with id " + id); } catch (RepositoryException re) { throw new ServiceException("Repository ex: " + re.Message); } catch (Exception ex) { throw new ServiceException(ex.Message); } }
public New Delete(int id) { return(_newRepository.Delete(id)); }
public void Delete(int id) { _newRepository.Delete(id); }
public bool Delete(int id) { return(newRepository.Delete(id)); }