public bool Delete(long id) { bool deleted = Repo.Delete(id); Unit.SaveChanges(); return(deleted); }
public ActionResult DeleteTarget(int id) { var target = _targetRepository.GetById(id); if (target == null) { return(NotFound()); } _notificationHub.Clients.All.SendAsync("SendMessage", "TargetDeleted"); _notificationHub.Clients.All.SendAsync("Notification", "Цель " + target.Title + " удалена."); _targetRepository.Delete(target); _targetRepository.SaveChanges(); return(NoContent()); }