public void HardDeleteTopic(Topic topic, User user) { if (user.IsInRole(PermanentRoles.Admin)) { _moderationLogService.LogTopic(user, ModerationType.TopicDeletePermanently, topic, null); _searchRepository.DeleteAllIndexedWordsForTopic(topic.TopicID); _topicRepository.HardDeleteTopic(topic.TopicID); var forum = _forumService.Get(topic.ForumID); _forumService.UpdateCounts(forum); _forumService.UpdateLast(forum); } else { throw new InvalidOperationException("User must be Admin to hard delete topic."); } }
public async Task DeleteAllIndexedWordsForTopic(Topic topic) { await _searchRepository.DeleteAllIndexedWordsForTopic(topic.TopicID); }
public void DeleteAllIndexedWordsForTopic(Topic topic) { _searchRepository.DeleteAllIndexedWordsForTopic(topic.TopicID); }