/// <summary> /// Find formatting tags in the text and transform them into static tags. /// </summary> /// <param name="text">The text to be transformed.</param> /// <param name="replyRepository">An instance of IReplyRepository.</param> /// <param name="isModerator">True if the current user is a moderator.</param> /// <returns>A formatted string.</returns> public static string SimplifyComplexTags(string text, IReplyRepository replyRepository, bool isModerator) { text = TransformTags(text, (content, optionalValue, tag) => { if (tag.Is("quote")) { string reformattedQuote = string.Format("[quote]{0}[/quote]", content); if (content.IsLong()) { Reply reply = replyRepository.GetReply(content.ToLong()); if (reply != null) { if (!reply.IsModsOnly() || isModerator) { reformattedQuote = string.Format("[quote][b]Posted by:[/b] [transmit]{0}[/transmit] on {1}\n\n{2}[/quote]", reply.Username, reply.PostedDate, reply.Body); } } } return(reformattedQuote); } else { return(null); } }); return(text); }
/// <summary> /// Find formatting tags in the text and transform them into static tags. /// </summary> /// <param name="text">The text to be transformed.</param> /// <param name="replyRepository">An instance of IReplyRepository.</param> /// <param name="isModerator">True if the current user is a moderator.</param> /// <returns>A formatted string.</returns> public static string SimplifyComplexTags(string text, IReplyRepository replyRepository, bool isModerator) { var parser = new BBCodeParser(new[] { new BBTag("quote", "", "", true, true, content => { string reformattedQuote = string.Format(@"[quote]{0}[/quote]", content); if (content.IsLong()) { Reply reply = replyRepository.GetReply(content.ToLong()); if (reply != null) { if (!reply.IsModsOnly() || isModerator) { var author = reply.Topic.Board.Anonymous ? "Anon" : reply.Username; reformattedQuote = string.Format("[quote]Posted by: [transmit=USER]{0}[/transmit] on {1}\n\n{2}[/quote]", author, reply.PostedDate, reply.Body); } } } return(reformattedQuote); }), }); return(parser.ToHtml(text, false)); }
// 解析依赖项获取接口实例 public ForumController(IPostRepository rep1, IUserInfoRepository rep2, ICommentRepository rep3, IReplyRepository rep4, IPraisedRepository rep5) { post_repository = rep1; user_repository = rep2; comment_repository = rep3; reply_repository = rep4; praised_repository = rep5; }
public UnitOfWork(DbContext dbContext, IPostRepository postRepository, IReplyRepository replyRepository, ITagRepository tagRepository) { _dbContext = dbContext; PostRepository = postRepository; ReplyRepository = replyRepository; TagRepository = tagRepository; }
public ReplyController( IReplyRepository replyRepository, UserManager <ApplicationUser> userManager ) { this._replyRepository = replyRepository; this._userManager = userManager; }
public GraphQLTypeBase( IArticleRepository articleRepository, IQuestionRepository questionRepository, IReplyRepository replyRepository) { _articleRepository = articleRepository; _questionRepository = questionRepository; _replyRepository = replyRepository; }
public ReplyDownloadController( IWebHostEnvironment environment, IReplyRepository repository, IFileStorageManager fileStorageManager) { this._environment = environment; this._repository = repository; this._fileStorageManager = fileStorageManager; }
public BOARD( IBoardRepository boardRepository, ITopicRepository topicRepository, IReplyRepository replyRepository ) { _boardRepository = boardRepository; _topicRepository = topicRepository; _replyRepository = replyRepository; }
public TOPIC( IReplyRepository replyRepository, ITopicRepository topicRepository, IBoardRepository boardRepository ) { _replyRepository = replyRepository; _topicRepository = topicRepository; _boardRepository = boardRepository; }
public ThreadController( IThreadRepository threadRepository, IReplyRepository replyRepository, ITagRepository tagRepository, UserManager <ApplicationUser> userManager) { this._replyRepository = replyRepository; this._threadRepository = threadRepository; this._tagRepository = tagRepository; this._userManager = userManager; }
public UnitOfWork(ApplicationDbContext context) { _context = context; Posts = new PostRepository(_context); Products = new ProductRepository(_context); Users = new ApplicationUserRepository(_context); Orders = new OrderRepository(_context); OrderProducts = new OrderProductRepository(_context); Tags = new TagRepository(_context); Images = new ImageRepository(_context); Replies = new ReplyRepository(_context); }
public HomeController(ICategoryRepository categoryRepository, IProductRepository productRepository, SignInManager <User> signInManager, ICommentRepository commentRepository, IReplyRepository replyRepository, IOrderRepository orderRepository, UserManager <User> userManager) { _categoryRepository = categoryRepository; _productRepository = productRepository; _signInManager = signInManager; _commentRepository = commentRepository; _replyRepository = replyRepository; _orderRepository = orderRepository; _userManager = userManager; }
public ReplyService( ILogger <IReplyRepository> logger, IReplyRepository replyRepository, IApiReplyRequestModelValidator replyModelValidator, IBOLReplyMapper bolreplyMapper, IDALReplyMapper dalreplyMapper) : base(logger, replyRepository, replyModelValidator, bolreplyMapper, dalreplyMapper) { }
public ReplyService( ILogger <ReplyService> logger, IMapper mapper, IPostService postService, IReplyRepository replyRepository, IUserService user) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _postService = postService ?? throw new ArgumentNullException(nameof(postService)); _replyRepository = replyRepository ?? throw new ArgumentNullException(nameof(replyRepository)); _userService = user ?? throw new ArgumentNullException(nameof(user)); }
public PostService(IUnitOfWork unitOfWork, IPostRepository postRepository, IReplyRepository replyRepository, IAccountRepository accountRepository, ISectionRepository seciontRepository) { this._unitOfWork = unitOfWork; this._postRepository = postRepository; this._replyRepository = replyRepository; this._accountRepository = accountRepository; this._sectionRepository = seciontRepository; this._postRepository.UnitOfWork = unitOfWork; this._replyRepository.UnitOfWork = unitOfWork; this._accountRepository.UnitOfWork = unitOfWork; this._sectionRepository.UnitOfWork = unitOfWork; }
public EvaluationToolController(IEvaluationToolApplicationService serviceEvaluationTool, IQuestionApplicationService serviceQuestion, IReplyRepository serviceReply, IFilledToolCoachApplicationService serviceFilledToolCoach, IFilledToolCoacheeApplicationService serviceFilledToolCoachee, ICoachApplicationService serviceCoach) { this._serviceEvaluationTool = serviceEvaluationTool; this._serviceQuestion = serviceQuestion; this._serviceReply = serviceReply; this._serviceFilledToolCoach = serviceFilledToolCoach; this._serviceFilledToolCoachee = serviceFilledToolCoachee; this._serviceCoach = serviceCoach; }
public AbstractReplyService( ILogger logger, IReplyRepository replyRepository, IApiReplyRequestModelValidator replyModelValidator, IBOLReplyMapper bolReplyMapper, IDALReplyMapper dalReplyMapper) : base() { this.ReplyRepository = replyRepository; this.ReplyModelValidator = replyModelValidator; this.BolReplyMapper = bolReplyMapper; this.DalReplyMapper = dalReplyMapper; this.logger = logger; }
public ReplyService( ILogger <IReplyService> logger, MediatR.IMediator mediator, IReplyRepository replyRepository, IApiReplyServerRequestModelValidator replyModelValidator, IDALReplyMapper dalReplyMapper) : base() { this.ReplyRepository = replyRepository; this.ReplyModelValidator = replyModelValidator; this.DalReplyMapper = dalReplyMapper; this.logger = logger; this.mediator = mediator; }
public StoriesController(IStoryRepository storyRepo, IReplyRepository replyRepo) { storyRepository = storyRepo; replyRepository = replyRepo; storyRepository.CreateTestData(3); replyRepository.CreateTestData(3); // Sort the stories by the first letter of the Header Property // in each story. // storyRepo.Stories.Sort((s1, s2) => // s1.Header.Substring(0).CompareTo( // s2.Header.Substring(0))); }
protected BaseReplyTest() { var logger = A.Fake <ILogger <ReplyService> >(); Mapper = A.Fake <IMapper>(); PostService = A.Fake <IPostService>(); ReplyRepository = A.Fake <IReplyRepository>(); User = A.Fake <IUserService>(); ReplyService = new ReplyService( logger, Mapper, PostService, ReplyRepository, User ); }
public ReplyService(IReplyRepository replyRepository, IMapper mapper, IUnitOfWork unitOfWork) { _unitOfWork = unitOfWork; _mapper = mapper; _replyRepository = replyRepository; }
public ClsQuery(IQueryRepository queryRepository, IReplyRepository replyRepository, IDocumentRepository documentrepository) { this.QueryRepository = queryRepository; this.ReplyRepository = replyRepository; this.DocumentRepository = documentrepository; }
public ReplyService(IReplyRepository replyRepository) { this.replyRepository = replyRepository; }
public ReplyManager(IReplyRepository repository) : base(repository) { this._replyRepository = repository; }
public LINK(ILinkRepository linkRepository, IReplyRepository replyRepository) { _linkRepository = linkRepository; _replyRepository = replyRepository; }
public ReplyApiController(IReplyRepository replyRepository, IMediator mediator) { _replyRepository = replyRepository; _mediator = mediator; }
public void Dispose() { _repository = null; }
public ReplyManager(IUnitOfWork unitOfWork) { _unitOfWork = unitOfWork; _replyRepository = _unitOfWork.ReplyRepository; }
public RepliesController(IReplyRepository repo, IMapper mapper) { this._mapper = mapper; this._repo = repo; }
public ApiReplyRequestModelValidator(IReplyRepository replyRepository) : base(replyRepository) { }
public ReplyApplicationService(IReplyRepository repository, IUnitOfWork unitOfWork) : base(unitOfWork) { this._repository = repository; }
/// <summary> /// Find formatting tags in the text and transform them into static tags. /// </summary> /// <param name="text">The text to be transformed.</param> /// <param name="replyRepository">An instance of IReplyRepository.</param> /// <param name="isModerator">True if the current user is a moderator.</param> /// <returns>A formatted string.</returns> public static string SimplifyComplexTags(string text, IReplyRepository replyRepository, bool isModerator) { text = TransformTags(text, (content, optionalValue, tag) => { if (tag.Is("quote")) { string reformattedQuote = string.Format("[quote]{0}[/quote]", content); if (content.IsLong()) { Reply reply = replyRepository.GetReply(content.ToLong()); if (reply != null) if (!reply.IsModsOnly() || isModerator) reformattedQuote = string.Format("[quote][b]Posted by:[/b] [transmit]{0}[/transmit] on {1}\n\n{2}[/quote]", reply.Username, reply.PostedDate, reply.Body); } return reformattedQuote; } else return null; }); return text; }
/// <summary> /// Find formatting tags in the text and transform them into static tags. /// </summary> /// <param name="text">The text to be transformed.</param> /// <param name="replyRepository">An instance of IReplyRepository.</param> /// <param name="isModerator">True if the current user is a moderator.</param> /// <returns>A formatted string.</returns> public static string SimplifyComplexTags(string text, IReplyRepository replyRepository, bool isModerator) { var parser = new BBCodeParser(new[] { new BBTag("quote", "", "", true, true, content => { string reformattedQuote = string.Format(@"[quote]{0}[/quote]", content); if (content.IsLong()) { Reply reply = replyRepository.GetReply(content.ToLong()); if (reply != null) if (!reply.IsModsOnly() || isModerator) { var author = reply.Topic.Board.Anonymous ? "Anon" : reply.Username; reformattedQuote = string.Format("[quote]Posted by: [transmit=USER]{0}[/transmit] on {1}\n\n{2}[/quote]", author, reply.PostedDate, reply.Body); } } return reformattedQuote; }), }); return parser.ToHtml(text, false); }
public UnitOfWork(ApplicationDbContext context) { _context = context; Posts = new PostRepository(_context); Replies = new ReplyRepository(_context); }
public ReplyController(IReplyRepository repo) { this.repo = repo; }