public void DeletePost(int postID) { var attachments = _attachmentRepository.Where(item => item.PostID == postID); _fileServices.DeleteAttachments(attachments); _postRepository.Delete(postID); _unitOfWork.Commit(); }
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(); }