示例#1
0
        public void DeletePost(int postID)
        {
            var attachments = _attachmentRepository.Where(item => item.PostID == postID);

            _fileServices.DeleteAttachments(attachments);
            _postRepository.Delete(postID);
            _unitOfWork.Commit();
        }
示例#2
0
        public void DeleteThread(int threadID)
        {
            Thread thread      = _threadRepository.Get(threadID);
            var    attachments = _attachmentRepository.Where(item => item.Post.ThreadID == threadID);

            _fileServices.DeleteAttachments(attachments);
            var posts = thread.Posts.ToList();

            _threadRepository.Delete(threadID);
            _unitOfWork.Commit();
        }