public QuestionController(IQuestionService questionService, ICategoryService categoryService,
			IVoteService voteService)
		{
			_questionService = questionService;
			_categoryService = categoryService;
			_voteService = voteService;
		}
예제 #2
0
 public VoteController(IBirthdayPeopleService birthdayPeople, IVoteService voteData, IPresentService presentData, IBirthdayData dbData)
 {
     this.birthdayData = birthdayPeople;
     this.voteData = voteData;
     this.presentData = presentData;
     this.dbData = dbData;
 }
예제 #3
0
 public CountdownController(ICountdownRepository countdownRepository,
                            IVoteService voteService,
                            IContextService contextService) {
     _countdownRepository = countdownRepository;
     _voteService = voteService;
     _contextService = contextService;
 }
예제 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="settingsService"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="uploadedFileService"></param>
 /// <param name="postService"></param>
 /// <param name="pollVoteService"></param>
 /// <param name="pollAnswerService"></param>
 /// <param name="pollService"></param>
 /// <param name="topicService"></param>
 /// <param name="favouriteService"></param>
 /// <param name="categoryService"></param>
 public MembershipService(IMVCForumContext context, ISettingsService settingsService,
     IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
     IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
     ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
     ICategoryNotificationService categoryNotificationService, ILoggingService loggingService, IUploadedFileService uploadedFileService,
     IPostService postService, IPollVoteService pollVoteService, IPollAnswerService pollAnswerService,
     IPollService pollService, ITopicService topicService, IFavouriteService favouriteService, 
     ICategoryService categoryService, IPostEditService postEditService)
 {
     _settingsService = settingsService;
     _emailService = emailService;
     _localizationService = localizationService;
     _activityService = activityService;
     _privateMessageService = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _loggingService = loggingService;
     _uploadedFileService = uploadedFileService;
     _postService = postService;
     _pollVoteService = pollVoteService;
     _pollAnswerService = pollAnswerService;
     _pollService = pollService;
     _topicService = topicService;
     _favouriteService = favouriteService;
     _categoryService = categoryService;
     _postEditService = postEditService;
     _context = context as MVCForumContext;
 }
예제 #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="membershipRepository"> </param>
 /// <param name="settingsRepository"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="uploadedFileService"></param>
 /// <param name="postRepository"></param>
 /// <param name="pollVoteRepository"></param>
 /// <param name="pollAnswerRepository"></param>
 /// <param name="pollRepository"></param>
 /// <param name="topicRepository"></param>
 /// <param name="favouriteRepository"></param>
 /// <param name="categoryService"></param>
 public MembershipService(IMembershipRepository membershipRepository, ISettingsRepository settingsRepository,
     IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
     IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
     ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
     ICategoryNotificationService categoryNotificationService, ILoggingService loggingService, IUploadedFileService uploadedFileService,
     IPostRepository postRepository, IPollVoteRepository pollVoteRepository, IPollAnswerRepository pollAnswerRepository,
     IPollRepository pollRepository, ITopicRepository topicRepository, IFavouriteRepository favouriteRepository,
     ICategoryService categoryService)
 {
     _membershipRepository = membershipRepository;
     _settingsRepository = settingsRepository;
     _emailService = emailService;
     _localizationService = localizationService;
     _activityService = activityService;
     _privateMessageService = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _loggingService = loggingService;
     _uploadedFileService = uploadedFileService;
     _postRepository = postRepository;
     _pollVoteRepository = pollVoteRepository;
     _pollAnswerRepository = pollAnswerRepository;
     _pollRepository = pollRepository;
     _topicRepository = topicRepository;
     _favouriteRepository = favouriteRepository;
     _categoryService = categoryService;
 }
예제 #6
0
 public CommentController(ICommentRepository commentRepository,
                          IVoteService voteService,
                          IContextService contextService) {
     _commentRepository = commentRepository;
     _voteService = voteService;
     _contextService = contextService;
 }
        public void TestsSetup()
        {
            AutoMapperConfig.RegisterMappings();

            this.votes = ServicesObjectFactory.GetVoteService();
            this.controller = new VotesController(this.votes);
            this.controller.Cache = new HttpCacheService();
        }
 public void Init()
 {
     _api = Substitute.For<IMVCForumAPI>();
     _activityService = Substitute.For<IActivityService>();
     _privateMessageService = Substitute.For<IPrivateMessageService>();
     _membershipUserPointsService = Substitute.For<IMembershipUserPointsService>();
     _topicNotificationService = Substitute.For<ITopicNotificationService>();
     _voteService = Substitute.For<IVoteService>();
     _badgeService = Substitute.For<IBadgeService>();
     _categoryNotificationService = Substitute.For<ICategoryNotificationService>();
     _loggingService = Substitute.For<ILoggingService>();
 }
예제 #9
0
 public SearchController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager,
     IMembershipService membershipService, ILocalizationService localizationService,
     IRoleService roleService, ISettingsService settingsService,
     IPostService postService, ITopicService topicService, IVoteService voteService, IFavouriteService favouriteService, ICategoryService categoryService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _postService = postService;
     _topicsService = topicService;
     _voteService = voteService;
     _favouriteService = favouriteService;
     _categoryService = categoryService;
 }
예제 #10
0
 public MembersController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, ILocalizationService localizationService,
     IRoleService roleService, ISettingsService settingsService, IPostService postService, IReportService reportService, IEmailService emailService, IPrivateMessageService privateMessageService, IBannedEmailService bannedEmailService, IBannedWordService bannedWordService, ITopicNotificationService topicNotificationService, IPollAnswerService pollAnswerService, IVoteService voteService, ICategoryService categoryService, ITopicService topicService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _postService = postService;
     _reportService = reportService;
     _emailService = emailService;
     _privateMessageService = privateMessageService;
     _bannedEmailService = bannedEmailService;
     _bannedWordService = bannedWordService;
     _categoryService = categoryService;
     _topicService = topicService;
 }
예제 #11
0
 public PostService(IMembershipUserPointsService membershipUserPointsService, IVoteService voteService, IFavouriteService favouriteService, IUploadedFileService uploadedFileService,
     ISettingsService settingsService, IRoleService roleService, IPostRepository postRepository, ITopicRepository topicRepository,
     ILocalizationService localizationService)
 {
     _voteService = voteService;
     _favouriteService = favouriteService;
     _uploadedFileService = uploadedFileService;
     _postRepository = postRepository;
     _topicRepository = topicRepository;
     _roleService = roleService;
     _membershipUserPointsService = membershipUserPointsService;
     _settingsService = settingsService;
     _localizationService = localizationService;
 }
예제 #12
0
        public SearchController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager,
            IMembershipService membershipService, ILocalizationService localizationService,
            IRoleService roleService, ISettingsService settingsService,
            IPostService postService, ITopicService topicService, IVoteService voteService, IFavouriteService favouriteService, ICategoryService categoryService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _postService = postService;
            _topicsService = topicService;
            _voteService = voteService;
            _favouriteService = favouriteService;
            _categoryService = categoryService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
            UsersRole = LoggedOnUser == null ? RoleService.GetRole(AppConstants.GuestRoleName) : LoggedOnUser.Roles.FirstOrDefault();
        }
예제 #13
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="loggingService"> </param>
 /// <param name="unitOfWorkManager"> </param>
 /// <param name="membershipService"></param>
 /// <param name="localizationService"></param>
 /// <param name="roleService"></param>
 /// <param name="categoryService"></param>
 /// <param name="settingsService"> </param>
 /// <param name="topicService"> </param>
 /// <param name="categoryNotificationService"> </param>
 public CategoryController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager,
     IMembershipService membershipService,
     ILocalizationService localizationService,
     IRoleService roleService,
     ICategoryService categoryService,
     ISettingsService settingsService, ITopicService topicService, ICategoryNotificationService categoryNotificationService, IPollAnswerService pollAnswerService, ITopicNotificationService topicNotificationService, IVoteService voteService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _categoryService = categoryService;
     _topicService = topicService;
     _categoryNotificationService = categoryNotificationService;
     _pollAnswerService = pollAnswerService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
 }
예제 #14
0
 public PostService(IMVCForumContext context,IMembershipUserPointsService membershipUserPointsService,
     ISettingsService settingsService, IRoleService roleService,
     ILocalizationService localizationService, IVoteService voteService, IUploadedFileService uploadedFileService, IFavouriteService favouriteService, IConfigService configService, IPostEditService postEditService)
 {
     _roleService = roleService;
     _membershipUserPointsService = membershipUserPointsService;
     _settingsService = settingsService;
     _localizationService = localizationService;
     _voteService = voteService;
     _uploadedFileService = uploadedFileService;
     _favouriteService = favouriteService;
     _configService = configService;
     _postEditService = postEditService;
     _context = context as MVCForumContext;
 }
예제 #15
0
 public PostController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService,
                       ILocalizationService localizationService, IRoleService roleService, ITopicService topicService, IPostService postService,
                       ISettingsService settingsService, ICategoryService categoryService,
                       ITopicNotificationService topicNotificationService, IEmailService emailService, IReportService reportService, IBannedWordService bannedWordService, IVoteService voteService, IPostEditService postEditService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicService             = topicService;
     _postService              = postService;
     _categoryService          = categoryService;
     _topicNotificationService = topicNotificationService;
     _emailService             = emailService;
     _reportService            = reportService;
     _bannedWordService        = bannedWordService;
     _voteService              = voteService;
     _postEditService          = postEditService;
 }
예제 #16
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="loggingService"> </param>
 /// <param name="unitOfWorkManager"> </param>
 /// <param name="membershipService"></param>
 /// <param name="localizationService"></param>
 /// <param name="roleService"></param>
 /// <param name="categoryService"></param>
 /// <param name="settingsService"> </param>
 /// <param name="topicService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="pollAnswerService"></param>
 /// <param name="topicNotificationService"></param>
 /// <param name="voteService"></param>
 public CategoryController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager,
                           IMembershipService membershipService,
                           ILocalizationService localizationService,
                           IRoleService roleService,
                           ICategoryService categoryService,
                           ISettingsService settingsService, ITopicService topicService, ICategoryNotificationService categoryNotificationService, IPollAnswerService pollAnswerService, ITopicNotificationService topicNotificationService, IVoteService voteService, IRoleService roleService1)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _categoryService             = categoryService;
     _topicService                = topicService;
     _categoryNotificationService = categoryNotificationService;
     _pollAnswerService           = pollAnswerService;
     _topicNotificationService    = topicNotificationService;
     _voteService = voteService;
     _roleService = roleService1;
 }
예제 #17
0
 public HomeController(IAnswerService answerService, IAnswerDescriptionService answerDescriptionService,
                       IResourcesService resourcesService, IUserService userService, IVoteService voteService,
                       ILoggerFactory loggerFactory, IOptions <AppSettings> appSettings, IHelpItemService helpItemService,
                       ISearchEntryService searchEntryService)
 {
     _userService              = userService;
     _answerService            = answerService;
     _answerDescriptionService = answerDescriptionService;
     _resourcesService         = resourcesService;
     _voteService              = voteService;
     _helpItemService          = helpItemService;
     _appSettings              = appSettings;
     _searchEntryService       = searchEntryService;
     _logger = loggerFactory.CreateLogger <HomeController>();
     _logger.LogInformation("created HomeController");
 }
예제 #18
0
 public TopicService(IMVCForumContext context, IMembershipUserPointsService membershipUserPointsService,
     ISettingsService settingsService, ITopicNotificationService topicNotificationService,
     IVoteService voteService, IUploadedFileService uploadedFileService, IFavouriteService favouriteService,
     IPostService postService, IRoleService roleService, IPollService pollService, IPollAnswerService pollAnswerService)
 {
     _membershipUserPointsService = membershipUserPointsService;
     _settingsService = settingsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _uploadedFileService = uploadedFileService;
     _favouriteService = favouriteService;
     _postService = postService;
     _roleService = roleService;
     _pollService = pollService;
     _pollAnswerService = pollAnswerService;
     _context = context as MVCForumContext;
 }
예제 #19
0
 public PostService(IMvcForumContext context, IMembershipUserPointsService membershipUserPointsService,
                    ISettingsService settingsService, IRoleService roleService,
                    IVoteService voteService,
                    IUploadedFileService uploadedFileService, IFavouriteService favouriteService,
                    IConfigService configService, IPostEditService postEditService, IGroupService groupService)
 {
     _roleService = roleService;
     _membershipUserPointsService = membershipUserPointsService;
     _settingsService             = settingsService;
     _voteService         = voteService;
     _uploadedFileService = uploadedFileService;
     _favouriteService    = favouriteService;
     _configService       = configService;
     _postEditService     = postEditService;
     _groupService        = groupService;
     _context             = context;
 }
예제 #20
0
        public MembersController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, ILocalizationService localizationService,
            IRoleService roleService, ISettingsService settingsService, IPostService postService, IReportService reportService, IEmailService emailService, IPrivateMessageService privateMessageService, IBannedEmailService bannedEmailService, IBannedWordService bannedWordService, ITopicNotificationService topicNotificationService, IPollAnswerService pollAnswerService, IVoteService voteService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _postService = postService;
            _reportService = reportService;
            _emailService = emailService;
            _privateMessageService = privateMessageService;
            _bannedEmailService = bannedEmailService;
            _bannedWordService = bannedWordService;
            _topicNotificationService = topicNotificationService;
            _pollAnswerService = pollAnswerService;
            _voteService = voteService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
            UsersRole = LoggedOnUser == null ? RoleService.GetRole(AppConstants.GuestRoleName) : LoggedOnUser.Roles.FirstOrDefault();
        }
예제 #21
0
 public VoteController(
     ApiSettings settings,
     ILogger <VoteController> logger,
     ITransactionCoordinator transactionCoordinator,
     IVoteService voteService,
     IApiVoteModelMapper voteModelMapper
     )
     : base(settings,
            logger,
            transactionCoordinator,
            voteService,
            voteModelMapper)
 {
     this.BulkInsertLimit = 250;
     this.MaxLimit        = 1000;
     this.DefaultLimit    = 250;
 }
예제 #22
0
 public TopicService(IMVCForumContext context, IMembershipUserPointsService membershipUserPointsService,
                     ISettingsService settingsService, ITopicNotificationService topicNotificationService,
                     IVoteService voteService, IUploadedFileService uploadedFileService, IFavouriteService favouriteService,
                     IPostService postService, IRoleService roleService, IPollService pollService, IPollAnswerService pollAnswerService)
 {
     _membershipUserPointsService = membershipUserPointsService;
     _settingsService             = settingsService;
     _topicNotificationService    = topicNotificationService;
     _voteService         = voteService;
     _uploadedFileService = uploadedFileService;
     _favouriteService    = favouriteService;
     _postService         = postService;
     _roleService         = roleService;
     _pollService         = pollService;
     _pollAnswerService   = pollAnswerService;
     _context             = context as MVCForumContext;
 }
예제 #23
0
 public VoteController(ILoggingService loggingService,
     IUnitOfWorkManager unitOfWorkManager,
     IMembershipService membershipService,
     ILocalizationService localizationService,
     IRoleService roleService,
     IPostService postService,
     IVoteService voteService,
     ISettingsService settingsService,
     ITopicService topicService,
     IMembershipUserPointsService membershipUserPointsService,
     ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService, cacheService)
 {
     _postService = postService;
     _voteService = voteService;
     _topicService = topicService;
     _membershipUserPointsService = membershipUserPointsService;
 }
예제 #24
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="loggingService"> </param>
        /// <param name="unitOfWorkManager"> </param>
        /// <param name="membershipService"></param>
        /// <param name="localizationService"></param>
        /// <param name="roleService"></param>
        /// <param name="categoryService"></param>
        /// <param name="settingsService"> </param>
        /// <param name="topicService"> </param>
        /// <param name="categoryNotificationService"> </param>
        public CategoryController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager,
                                  IMembershipService membershipService,
                                  ILocalizationService localizationService,
                                  IRoleService roleService,
                                  ICategoryService categoryService,
                                  ISettingsService settingsService, ITopicService topicService, ICategoryNotificationService categoryNotificationService, IPollAnswerService pollAnswerService, ITopicNotificationService topicNotificationService, IVoteService voteService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _categoryService             = categoryService;
            _topicService                = topicService;
            _categoryNotificationService = categoryNotificationService;
            _pollAnswerService           = pollAnswerService;
            _topicNotificationService    = topicNotificationService;
            _voteService = voteService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
            UsersRole    = LoggedOnUser == null?RoleService.GetRole(AppConstants.GuestRoleName) : LoggedOnUser.Roles.FirstOrDefault();
        }
예제 #25
0
 public TopicController(ILoggingService loggingService, IMembershipService membershipService,
                        IRoleService roleService, ITopicService topicService, IPostService postService,
                        ICategoryService categoryService, ILocalizationService localizationService,
                        ISettingsService settingsService, ITopicTagService topicTagService,
                        IPollService pollService, IVoteService voteService, IFavouriteService favouriteService, ICacheService cacheService,
                        IMvcForumContext context, INotificationService notificationService)
     : base(loggingService, membershipService, localizationService, roleService,
            settingsService, cacheService, context)
 {
     _topicService        = topicService;
     _postService         = postService;
     _categoryService     = categoryService;
     _topicTagService     = topicTagService;
     _pollService         = pollService;
     _voteService         = voteService;
     _favouriteService    = favouriteService;
     _notificationService = notificationService;
 }
예제 #26
0
 public VoteController(ILoggingService loggingService,
                       IUnitOfWorkManager unitOfWorkManager,
                       IMembershipService membershipService,
                       ILocalizationService localizationService,
                       IRoleService roleService,
                       IPostService postService,
                       IVoteService voteService,
                       ISettingsService settingsService,
                       ITopicService topicService,
                       IMembershipUserPointsService membershipUserPointsService,
                       ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService, cacheService)
 {
     _postService  = postService;
     _voteService  = voteService;
     _topicService = topicService;
     _membershipUserPointsService = membershipUserPointsService;
 }
예제 #27
0
 public UserScrubPipe(IVoteService voteService, IBadgeService badgeService,
                      INotificationService notificationService, IPrivateMessageService privateMessageService,
                      IFavouriteService favouriteService, IMembershipUserPointsService membershipUserPointsService,
                      IActivityService activityService, IPollService pollService, ITopicService topicService,
                      ICategoryService categoryService, IPostService postService, ILoggingService loggingService)
 {
     _voteService                 = voteService;
     _badgeService                = badgeService;
     _notificationService         = notificationService;
     _privateMessageService       = privateMessageService;
     _favouriteService            = favouriteService;
     _membershipUserPointsService = membershipUserPointsService;
     _activityService             = activityService;
     _pollService                 = pollService;
     _topicService                = topicService;
     _categoryService             = categoryService;
     _postService                 = postService;
     _loggingService              = loggingService;
 }
예제 #28
0
 public ProblemController(
     UserManager <UserInfo> userManager,
     IProblemService problemService,
     IContestService contestService,
     IJudgeService judgeService,
     ILanguageService languageService,
     IFileService fileService,
     IVoteService voteService,
     WebHostDbContext dbContext)
 {
     this.userManager     = userManager;
     this.problemService  = problemService;
     this.contestService  = contestService;
     this.judgeService    = judgeService;
     this.languageService = languageService;
     this.fileService     = fileService;
     this.voteService     = voteService;
     this.dbContext       = dbContext;
 }
예제 #29
0
 public PostController(ILoggingService loggingService, IMembershipService membershipService,
                       ILocalizationService localizationService, IRoleService roleService, ITopicService topicService,
                       IPostService postService, ISettingsService settingsService, ICategoryService categoryService,
                       ITopicNotificationService topicNotificationService, IEmailService emailService,
                       IReportService reportService, IBannedWordService bannedWordService, IVoteService voteService,
                       IPostEditService postEditService, ICacheService cacheService, IMvcForumContext context, IActivityService activityService)
     : base(loggingService, membershipService, localizationService, roleService,
            settingsService, cacheService, context)
 {
     _topicService             = topicService;
     _postService              = postService;
     _categoryService          = categoryService;
     _topicNotificationService = topicNotificationService;
     _emailService             = emailService;
     _reportService            = reportService;
     _bannedWordService        = bannedWordService;
     _voteService              = voteService;
     _postEditService          = postEditService;
     _activityService          = activityService;
 }
예제 #30
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="membershipRepository"> </param>
 /// <param name="settingsRepository"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="api"> </param>
 /// <param name="loggingService"></param>
 public MembershipService(IMembershipRepository membershipRepository, ISettingsRepository settingsRepository,
                          IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
                          IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
                          ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
                          ICategoryNotificationService categoryNotificationService, IMVCForumAPI api, ILoggingService loggingService)
 {
     _membershipRepository        = membershipRepository;
     _settingsRepository          = settingsRepository;
     _emailService                = emailService;
     _localizationService         = localizationService;
     _activityService             = activityService;
     _privateMessageService       = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService    = topicNotificationService;
     _voteService  = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _api            = api;
     _loggingService = loggingService;
 }
예제 #31
0
 public WeChatController(
     ILogger <WeChatController> logger,
     IWeChatContainer container,
     IAppService appService,
     IMenuService menuService,
     IMediaService mediaService,
     INewsService newsService,
     IActivityService activityService,
     IVoteService voteService)
     : base(logger)
 {
     this.logger          = logger;
     this.app             = container.GetApp();
     this.appService      = appService;
     this.menuService     = menuService;
     this.mediaService    = mediaService;
     this.newsService     = newsService;
     this.activityService = activityService;
     this.voteService     = voteService;
 }
예제 #32
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="membershipRepository"> </param>
 /// <param name="settingsRepository"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="api"> </param>
 /// <param name="loggingService"></param>
 public MembershipService(IMembershipRepository membershipRepository, ISettingsRepository settingsRepository,
     IEmailService emailService, ILocalizationService localizationService, IActivityService activityService, 
     IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService, 
     ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
     ICategoryNotificationService categoryNotificationService, IMVCForumAPI api, ILoggingService loggingService)
 {
     _membershipRepository = membershipRepository;
     _settingsRepository = settingsRepository;
     _emailService = emailService;
     _localizationService = localizationService;
     _activityService = activityService;
     _privateMessageService = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _api = api;
     _loggingService = loggingService;
 }
예제 #33
0
 public FavouriteController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, IRoleService roleService, ITopicService topicService, IPostService postService,
                            ICategoryService categoryService, ILocalizationService localizationService, ISettingsService settingsService, ITopicTagService topicTagService, IMembershipUserPointsService membershipUserPointsService,
                            ICategoryNotificationService categoryNotificationService, IEmailService emailService, ITopicNotificationService topicNotificationService, IPollService pollService,
                            IPollAnswerService pollAnswerService, IBannedWordService bannedWordService, IVoteService voteService, IFavouriteService favouriteService, IBadgeService badgeService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicService                = topicService;
     _postService                 = postService;
     _categoryService             = categoryService;
     _topicTagService             = topicTagService;
     _membershipUserPointsService = membershipUserPointsService;
     _categoryNotificationService = categoryNotificationService;
     _emailService                = emailService;
     _topicNotificationService    = topicNotificationService;
     _pollService                 = pollService;
     _pollAnswerService           = pollAnswerService;
     _bannedWordService           = bannedWordService;
     _voteService                 = voteService;
     _favouriteService            = favouriteService;
     _badgeService                = badgeService;
 }
예제 #34
0
        public VoteController(ILoggingService loggingService,
            IUnitOfWorkManager unitOfWorkManager,
            IMembershipService membershipService,
            ILocalizationService localizationService,
            IRoleService roleService,
            IPostService postService,
            IVoteService voteService,
            ISettingsService settingsService,
            ITopicService topicService,
            IMembershipUserPointsService membershipUserPointsService,
            IBadgeService badgeService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _postService = postService;
            _voteService = voteService;
            _topicService = topicService;
            _membershipUserPointsService = membershipUserPointsService;
            _badgeService = badgeService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
        }
예제 #35
0
 public FavouriteController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, IRoleService roleService, ITopicService topicService, IPostService postService,
     ICategoryService categoryService, ILocalizationService localizationService, ISettingsService settingsService, ITopicTagService topicTagService, IMembershipUserPointsService membershipUserPointsService,
     ICategoryNotificationService categoryNotificationService, IEmailService emailService, ITopicNotificationService topicNotificationService, IPollService pollService,
     IPollAnswerService pollAnswerService, IBannedWordService bannedWordService, IVoteService voteService, IFavouriteService favouriteService, IBadgeService badgeService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicService = topicService;
     _postService = postService;
     _categoryService = categoryService;
     _topicTagService = topicTagService;
     _membershipUserPointsService = membershipUserPointsService;
     _categoryNotificationService = categoryNotificationService;
     _emailService = emailService;
     _topicNotificationService = topicNotificationService;
     _pollService = pollService;
     _pollAnswerService = pollAnswerService;
     _bannedWordService = bannedWordService;
     _voteService = voteService;
     _favouriteService = favouriteService;
     _badgeService = badgeService;
 }
예제 #36
0
        public VoteController(ILoggingService loggingService,
                              IUnitOfWorkManager unitOfWorkManager,
                              IMembershipService membershipService,
                              ILocalizationService localizationService,
                              IRoleService roleService,
                              IPostService postService,
                              IVoteService voteService,
                              ISettingsService settingsService,
                              ITopicService topicService,
                              IMembershipUserPointsService membershipUserPointsService,
                              IBadgeService badgeService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _postService  = postService;
            _voteService  = voteService;
            _topicService = topicService;
            _membershipUserPointsService = membershipUserPointsService;
            _badgeService = badgeService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
        }
예제 #37
0
 public MembersController(ILoggingService loggingService,
                          IMembershipService membershipService,
                          ILocalizationService localizationService,
                          IRoleService roleService,
                          ISettingsService settingsService,
                          IPostService postService,
                          IReportService reportService,
                          IEmailService emailService,
                          IGroupService GroupService,
                          ITopicService topicService,
                          ICacheService cacheService,
                          INotificationService notificationService,
                          IPollService pollService,
                          IVoteService voteService,
                          IFavouriteService favouriteService,
                          IMvcForumContext context,
                          IGroupInviteService groupInviteService,
                          ISendEmailService sendEmailService,
                          IConfigurationProvider configurationProvider)
     : base(loggingService,
            membershipService,
            localizationService,
            roleService,
            settingsService,
            cacheService,
            context)
 {
     _postService           = postService;
     _reportService         = reportService;
     _emailService          = emailService;
     _groupService          = GroupService;
     _topicService          = topicService;
     _notificationService   = notificationService;
     _pollService           = pollService;
     _voteService           = voteService;
     _favouriteService      = favouriteService;
     _groupInviteService    = groupInviteService ?? throw new ArgumentNullException(nameof(groupInviteService));
     _sendEmailService      = sendEmailService ?? throw new ArgumentNullException(nameof(sendEmailService));
     _configurationProvider = configurationProvider ?? throw new ArgumentNullException(nameof(configurationProvider));
 }
예제 #38
0
 public UserScrubPipe(IVoteService voteService,
                      INotificationService notificationService,
                      IFavouriteService favouriteService,
                      IMembershipUserPointsService membershipUserPointsService,
                      IActivityService activityService,
                      IPollService pollService,
                      ITopicService topicService,
                      IGroupService groupService,
                      IPostService postService,
                      ILoggingService loggingService)
 {
     _voteService                 = voteService;
     _notificationService         = notificationService;
     _favouriteService            = favouriteService;
     _membershipUserPointsService = membershipUserPointsService;
     _activityService             = activityService;
     _pollService                 = pollService;
     _topicService                = topicService;
     _groupService                = groupService;
     _postService                 = postService;
     _loggingService              = loggingService;
 }
예제 #39
0
        public virtual async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            var mapper = new ApiVoteServerModelMapper();
            ApplicationDbContext       context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
            IVoteService               service = testServer.Host.Services.GetService(typeof(IVoteService)) as IVoteService;
            ApiVoteServerResponseModel model   = await service.Get(1);

            ApiVoteClientRequestModel request = mapper.MapServerResponseToClientRequest(model);

            request.SetProperties(2, DateTime.Parse("1/1/1988 12:00:00 AM"), 1, 1, 1);

            UpdateResponse <ApiVoteClientResponseModel> updateResponse = await client.VoteUpdateAsync(model.Id, request);

            context.Entry(context.Set <Vote>().ToList()[0]).Reload();
            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
            updateResponse.Record.Id.Should().Be(1);
            context.Set <Vote>().ToList()[0].BountyAmount.Should().Be(2);
            context.Set <Vote>().ToList()[0].CreationDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM"));
            context.Set <Vote>().ToList()[0].PostId.Should().Be(1);
            context.Set <Vote>().ToList()[0].UserId.Should().Be(1);
            context.Set <Vote>().ToList()[0].VoteTypeId.Should().Be(1);

            updateResponse.Record.Id.Should().Be(1);
            updateResponse.Record.BountyAmount.Should().Be(2);
            updateResponse.Record.CreationDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM"));
            updateResponse.Record.PostId.Should().Be(1);
            updateResponse.Record.UserId.Should().Be(1);
            updateResponse.Record.VoteTypeId.Should().Be(1);
        }
예제 #40
0
        public FavouriteController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, IRoleService roleService, ITopicService topicService, IPostService postService,
                                   ICategoryService categoryService, ILocalizationService localizationService, ISettingsService settingsService, ITopicTagService topicTagService, IMembershipUserPointsService membershipUserPointsService,
                                   ICategoryNotificationService categoryNotificationService, IEmailService emailService, ITopicNotificationService topicNotificationService, IPollService pollService,
                                   IPollAnswerService pollAnswerService, IBannedWordService bannedWordService, IVoteService voteService, IFavouriteService favouriteService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _topicService                = topicService;
            _postService                 = postService;
            _categoryService             = categoryService;
            _topicTagService             = topicTagService;
            _membershipUserPointsService = membershipUserPointsService;
            _categoryNotificationService = categoryNotificationService;
            _emailService                = emailService;
            _topicNotificationService    = topicNotificationService;
            _pollService                 = pollService;
            _pollAnswerService           = pollAnswerService;
            _bannedWordService           = bannedWordService;
            _voteService                 = voteService;
            _favouriteService            = favouriteService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
            UsersRole    = LoggedOnUser == null?RoleService.GetRole(AppConstants.GuestRoleName) : LoggedOnUser.Roles.FirstOrDefault();
        }
예제 #41
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="settingsService"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="cacheService"></param>
 /// <param name="voteService"></param>
 /// <param name="badgeService"></param>
 /// <param name="categoryNotificationService"></param>
 /// <param name="privateMessageService"></param>
 /// <param name="favouriteService"></param>
 public MembershipService(IMvcForumContext context, ISettingsService settingsService,
                          IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
                          ILoggingService loggingService, ICacheService cacheService, IVoteService voteService, IBadgeService badgeService, ICategoryNotificationService categoryNotificationService, IPrivateMessageService privateMessageService, IFavouriteService favouriteService, ITopicNotificationService topicNotificationService, IMembershipUserPointsService membershipUserPointsService, IPollVoteService pollVoteService, ITopicService topicService, ICategoryService categoryService, IPostService postService)
 {
     _settingsService             = settingsService;
     _emailService                = emailService;
     _localizationService         = localizationService;
     _activityService             = activityService;
     _loggingService              = loggingService;
     _cacheService                = cacheService;
     _voteService                 = voteService;
     _badgeService                = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _privateMessageService       = privateMessageService;
     _favouriteService            = favouriteService;
     _topicNotificationService    = topicNotificationService;
     _membershipUserPointsService = membershipUserPointsService;
     _pollVoteService             = pollVoteService;
     _topicService                = topicService;
     _categoryService             = categoryService;
     _postService                 = postService;
     _context = context;
 }
예제 #42
0
        public FavouriteController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, IRoleService roleService, ITopicService topicService, IPostService postService,
            ICategoryService categoryService, ILocalizationService localizationService, ISettingsService settingsService, ITopicTagService topicTagService, IMembershipUserPointsService membershipUserPointsService,
            ICategoryNotificationService categoryNotificationService, IEmailService emailService, ITopicNotificationService topicNotificationService, IPollService pollService,
            IPollAnswerService pollAnswerService, IBannedWordService bannedWordService, IVoteService voteService, IFavouriteService favouriteService)
            : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
        {
            _topicService = topicService;
            _postService = postService;
            _categoryService = categoryService;
            _topicTagService = topicTagService;
            _membershipUserPointsService = membershipUserPointsService;
            _categoryNotificationService = categoryNotificationService;
            _emailService = emailService;
            _topicNotificationService = topicNotificationService;
            _pollService = pollService;
            _pollAnswerService = pollAnswerService;
            _bannedWordService = bannedWordService;
            _voteService = voteService;
            _favouriteService = favouriteService;

            LoggedOnUser = UserIsAuthenticated ? MembershipService.GetUser(Username) : null;
            UsersRole = LoggedOnUser == null ? RoleService.GetRole(AppConstants.GuestRoleName) : LoggedOnUser.Roles.FirstOrDefault();
        }
예제 #43
0
 public QuestionService(
     IQuestionRepository questionRepository,
     IUserRepository userRepository,
     IUnitOfWork uow,
     ICommentService commentService,
     ICache cache,
     IVoteRepository voteRepository,
     IVoteService voteService,
     ITagService tagService,
     BaseLimits limits,
     IMapper mapper)
 {
     _questionRepository = questionRepository;
     _userRepository     = userRepository;
     _uow            = uow;
     _commentService = commentService;
     _cache          = cache;
     _voteRepository = voteRepository;
     _voteService    = voteService;
     _tagService     = tagService;
     _limits         = limits;
     _mapper         = mapper;
 }
        public RestaurantsControllerTests()
        {
            this.dbContext     = MockDbContext.GetContext();
            this.configuration = new ConfigurationBuilder()
                                 .AddJsonFile("settings.json")
                                 .Build();

            this.restaurantImagesRepository = new EfDeletableEntityRepository <RestaurantImage>(this.dbContext);
            this.categoryImageRepository    = new EfDeletableEntityRepository <CategoryImage>(this.dbContext);
            this.restaurantRepository       = new EfDeletableEntityRepository <Restaurant>(this.dbContext);
            this.categoryRepository         = new EfDeletableEntityRepository <Category>(this.dbContext);
            this.userRepository             = new EfDeletableEntityRepository <ApplicationUser>(this.dbContext);
            this.favouriteRepository        = new EfRepository <FavouriteRestaurant>(this.dbContext);
            this.voteRepository             = new EfRepository <Vote>(this.dbContext);
            this.commentRepository          = new EfDeletableEntityRepository <Comment>(this.dbContext);

            this.cloudinaryService       = new CloudinaryImageService(this.configuration);
            this.voteService             = new VoteService(this.voteRepository);
            this.commentService          = new CommentService(this.commentRepository, this.voteService);
            this.restaurantImagesService = new RestaurantImageService(this.restaurantImagesRepository, this.cloudinaryService);
            this.restaurantService       = new RestaurantService(this.restaurantRepository, this.restaurantImagesService, this.commentService);
            this.userImageService        = new UserImageService(this.userRepository, this.cloudinaryService);

            this.categoryImageService = new CategoryImageService(this.categoryImageRepository, this.cloudinaryService);
            this.categoryService      = new CategoryService(this.categoryRepository, this.categoryImageService, this.restaurantService);
            this.userService          = new UserService(this.restaurantService, this.userImageService, this.userRepository);
            this.favouriteService     = new FavouriteService(this.favouriteRepository);

            var httpContext = new DefaultHttpContext();
            var tempData    = new TempDataDictionary(httpContext, Mock.Of <ITempDataProvider>());

            this.controller = new RestaurantsController(this.restaurantService, this.categoryService, this.userService, this.configuration, this.favouriteService)
            {
                TempData = tempData,
            };
            AutoMapperConfig.RegisterMappings(typeof(AllImagesFromRestaurantViewModel).Assembly);
        }
예제 #45
0
        /// <summary>
        /// Fill in answer details for content page.
        /// Reuse the logic between controllers. Also used by AnswerActionController.
        /// </summary>
        /// <param name="answer"></param>
        /// <param name="answerDescriptionService"></param>
        /// <param name="userManager"></param>
        /// <param name="voteService"></param>
        /// <param name="resourcesService"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public static AnswerDetailsDto FillInDetails(AnswerDto answer, IAnswerDescriptionService answerDescriptionService,
                                                     IUserService userService, IVoteService voteService, IResourcesService resourcesService, string culture, string fullDomainName)
        {
            // Load answer descriptions
            // Have to do the list otherwise setting description.UserDisplayName below will not work.
            var searchResult = answerDescriptionService.FindByAnswerId(answer.Id);
            List <AnswerDescriptionDto> descriptions = searchResult == null ? null : searchResult.ToList();

            // Set the username for each description
            if (descriptions != null)
            {
                foreach (var description in descriptions)
                {
                    GetUserDisplayName(description, userService);
                }
            }

            // Fill in result
            var data = new AnswerDetailsDto()
            {
                Answer        = answer,
                CommonStrings = resourcesService.GetCommonStrings(culture),
                Descriptions  = descriptions,
                NumberVotes   = voteService.CountAnswerVotes(answer.Id)
            };

            GetUserDisplayName(data.Answer, userService);

            // Fill in link to this page and other usefull data.
            data.ThisAnswerLink            = LinkingHelper.ConvertAnswerToUrlWithCulture(culture, data.CommonStrings, answer);
            data.ThisAnswerFullLink        = fullDomainName.EndsWith("/") ? fullDomainName.Substring(0, fullDomainName.Length - 1) : fullDomainName + data.ThisAnswerLink;
            data.ThisAnswerText            = LinkingHelper.ConvertAnswerToText(data.CommonStrings, answer);
            data.ThisAnswerFullLinkEscaped = System.Uri.EscapeDataString(data.ThisAnswerFullLink);

            return(data);
        }
예제 #46
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="loggingService"> </param>
 /// <param name="membershipService"></param>
 /// <param name="localizationService"></param>
 /// <param name="roleService"></param>
 /// <param name="GroupService"></param>
 /// <param name="settingsService"> </param>
 /// <param name="topicService"> </param>
 /// <param name="cacheService"></param>
 /// <param name="postService"></param>
 /// <param name="pollService"></param>
 /// <param name="voteService"></param>
 /// <param name="favouriteService"></param>
 /// <param name="context"></param>
 /// <param name="notificationService"></param>
 public GroupController(ILoggingService loggingService, IMembershipService membershipService,
                        ILocalizationService localizationService, IRoleService roleService, IGroupService GroupService,
                        ISettingsService settingsService, ITopicService topicService,
                        ICacheService cacheService,
                        IPostService postService,
                        IPollService pollService, IVoteService voteService, IFavouriteService favouriteService,
                        IMvcForumContext context, INotificationService notificationService, IFeatureManager featureManager,
                        IImageCommand imageCommand)
     : base(loggingService, membershipService, localizationService, roleService,
            settingsService, cacheService, context)
 {
     _groupService        = GroupService;
     _topicService        = topicService;
     _pollAnswerService   = pollService;
     _voteService         = voteService;
     _favouriteService    = favouriteService;
     _notificationService = notificationService;
     _postService         = postService;
     _roleService         = roleService;
     _featureManager      = featureManager;
     _localizationService = localizationService;
     LoggedOnReadOnlyUser = membershipService.GetUser(System.Web.HttpContext.Current.User.Identity.Name, true);
     _imageCommand        = imageCommand ?? throw new ArgumentNullException(nameof(imageCommand));
 }
예제 #47
0
 public VotesController(IVoteService voteService, UserManager <ApplicationUser> userManager)
 {
     this.voteService = voteService;
     this.userManager = userManager;
 }
예제 #48
0
 public GrouchBadge()
 {
     _voteService = DependencyResolver.Current.GetService<IVoteService>();
 }
예제 #49
0
 public VoteController(IVoteService voteService, CachedUserManager <UserInfo> userManager)
 {
     this.voteService = voteService;
     this.userManager = userManager;
 }
 public VoteController(ILoggerManager logger, voting_dbContext dbContext)
 {
     _logger     = logger;
     voteService = new VoteService(dbContext);
 }
예제 #51
0
 public VoteHub(IVoteService voteService)
 {
     _voteService = voteService;
 }
예제 #52
0
 public VotesController(IVoteService votes)
 {
     this.votes = votes;
 }
예제 #53
0
 public VotesController(IMapper mapper, IVoteService voteService, IApartmentService apartmentService)
 {
     this._mapper           = mapper;
     this._voteService      = voteService;
     this._apartmentService = apartmentService;
 }
 public VoteController(IVoteService voteService)
 {
     this.voteService = voteService;
 }
예제 #55
0
 public VoteController(IUserService userService, IVoteService voteService)
 {
     this.userService = userService;
     this.voteService = voteService;
 }