Beispiel #1
0
 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.");
     }
 }
Beispiel #2
0
 public async Task DeleteAllIndexedWordsForTopic(Topic topic)
 {
     await _searchRepository.DeleteAllIndexedWordsForTopic(topic.TopicID);
 }
Beispiel #3
0
 public void DeleteAllIndexedWordsForTopic(Topic topic)
 {
     _searchRepository.DeleteAllIndexedWordsForTopic(topic.TopicID);
 }