コード例 #1
0
        public CategoriesControllerTests()
        {
            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.favouriteRepository        = new EfRepository <FavouriteRestaurant>(this.dbContext);
            this.voteRepository             = new EfRepository <Vote>(this.dbContext);
            this.commentRepository          = new EfDeletableEntityRepository <Comment>(this.dbContext);

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

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

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

            this.controller = new CategoriesController(this.categoryService, this.restaurantService, this.favouriteService)
            {
                TempData = tempData,
            };

            AutoMapperConfig.RegisterMappings(typeof(ErrorViewModel).Assembly);
        }
コード例 #2
0
        public static List <TopicViewModel> CreateTopicViewModels(List <Topic> topics,
                                                                  IRoleService roleService,
                                                                  MembershipRole usersRole,
                                                                  MembershipUser loggedOnUser,
                                                                  List <Category> allowedCategories,
                                                                  Settings settings,
                                                                  IPostService postService,
                                                                  ITopicNotificationService topicNotificationService,
                                                                  IPollAnswerService pollAnswerService,
                                                                  IVoteService voteService,
                                                                  IFavouriteService favouriteService)
        {
            // Get all topic Ids
            var topicIds = topics.Select(x => x.Id).ToList();

            // Gets posts for topics
            var posts        = postService.GetPostsByTopics(topicIds, allowedCategories);
            var groupedPosts = posts.ToLookup(x => x.Topic.Id);

            // Get all permissions
            var permissions = GetPermissionsForTopics(topics, roleService, usersRole);

            // Create the view models
            var viewModels = new List <TopicViewModel>();

            foreach (var topic in topics)
            {
                var id         = topic.Id;
                var permission = permissions[topic.Category];
                var topicPosts = groupedPosts.Contains(id) ? groupedPosts[id].ToList() : new List <Post>();
                viewModels.Add(CreateTopicViewModel(topic, permission, topicPosts, null, null, null, null, loggedOnUser,
                                                    settings, topicNotificationService, pollAnswerService, voteService, favouriteService));
            }
            return(viewModels);
        }
コード例 #3
0
        static ManageFavourite()
        {
            IUnityContainer container =
             (IUnityContainer)HttpContext.Current.Application["unityContainer"];

            favouriteService = container.Resolve<IFavouriteService>();
        }
コード例 #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
 // GET: Month
 public ChartPeriodController(IDataService dataService,
                              ICommentService commentService,
                              IWebHostEnvironment environment,
                              IActionPlanService actionPlanService,
                              ISettingService settingService,
                              IMailHelper mailHelper,
                              IKPILevelService kPILevelService,
                              IFavouriteService favouriteService,
                              IConfiguration configuaration,
                              IHubContext <HenryHub> hubContext,
                              INotificationService notificationService, IConfiguration configuration)
 {
     _environment         = environment;
     _configuration       = configuration;
     _dataService         = dataService;
     _commentService      = commentService;
     _actionPlanService   = actionPlanService;
     _settingService      = settingService;
     _mailHelper          = mailHelper;
     _kPILevelService     = kPILevelService;
     _favouriteService    = favouriteService;
     _configuaration      = configuaration;
     _hubContext          = hubContext;
     _notificationService = notificationService;
 }
コード例 #6
0
ファイル: MembershipService.cs プロジェクト: flerka/mvcforum
 /// <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;
 }
コード例 #7
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="settingsService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="cacheService"></param>
 /// <param name="voteService"></param>
 /// <param name="badgeService"></param>
 /// <param name="privateMessageService"></param>
 /// <param name="favouriteService"></param>
 /// <param name="membershipUserPointsService"></param>
 /// <param name="topicService"></param>
 /// <param name="categoryService"></param>
 /// <param name="postService"></param>
 /// <param name="notificationService"></param>
 /// <param name="pollService"></param>
 public MembershipService(IMvcForumContext context, ISettingsService settingsService,
                          ILocalizationService localizationService,
                          IActivityService activityService, ICacheService cacheService, IVoteService voteService,
                          IBadgeService badgeService,
                          IPrivateMessageService privateMessageService,
                          IFavouriteService favouriteService, IMembershipUserPointsService membershipUserPointsService,
                          ITopicService topicService, ICategoryService categoryService, IPostService postService,
                          INotificationService notificationService, IPollService pollService)
 {
     _settingsService             = settingsService;
     _localizationService         = localizationService;
     _activityService             = activityService;
     _cacheService                = cacheService;
     _voteService                 = voteService;
     _badgeService                = badgeService;
     _privateMessageService       = privateMessageService;
     _favouriteService            = favouriteService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicService                = topicService;
     _categoryService             = categoryService;
     _postService                 = postService;
     _notificationService         = notificationService;
     _pollService                 = pollService;
     _context = context;
 }
コード例 #8
0
        public static void MyClassInitialize(TestContext testContext)
        {
            container = TestManager.ConfigureUnityContainer("unity");

            userService = container.Resolve<IUserService>();
            favouriteService = container.Resolve<IFavouriteService>();
            favouriteDao = container.Resolve<IFavouriteDao>();
        }
コード例 #9
0
 public FavouriteViewModel(
     IFavouriteService <ChuckJoke> favouriteService,
     INavigationService navigationService)
     : base(navigationService)
 {
     this.favouriteService = favouriteService;
     RemoveCommand         = new Command <ChuckJoke>(Remove);
 }
コード例 #10
0
 public CategoriesController(
     ICategoryService categoryService,
     IRestaurantService restaurantService,
     IFavouriteService favouriteService)
 {
     this.categoryService   = categoryService;
     this.restaurantService = restaurantService;
     this.favouriteService  = favouriteService;
 }
コード例 #11
0
 public TopicDeletePipe(IFavouriteService favouriteService, IPollService pollService, IPostService postService, INotificationService notificationService, ILoggingService loggingService, ICacheService cacheService)
 {
     _favouriteService    = favouriteService;
     _pollService         = pollService;
     _postService         = postService;
     _notificationService = notificationService;
     _loggingService      = loggingService;
     _cacheService        = cacheService;
 }
コード例 #12
0
        static AddFavourite() {
            IUnityContainer container =
             (IUnityContainer)HttpContext.Current.Application["unityContainer"];

            favouriteService = container.Resolve<IFavouriteService>(); 
            productService   = container.Resolve<IProductService>();
            commentService = container.Resolve<ICommentService>();

        }
コード例 #13
0
        public static List <TopicViewModel> CreateTopicViewModels(List <Topic> topics,
                                                                  IRoleService roleService,
                                                                  MembershipRole usersRole,
                                                                  MembershipUser loggedOnUser,
                                                                  List <Group> allowedGroups,
                                                                  Settings settings,
                                                                  IPostService postService,
                                                                  INotificationService topicNotificationService,
                                                                  IPollService pollService,
                                                                  IVoteService voteService,
                                                                  IFavouriteService favouriteService)
        {
            // Get all topic Ids
            var topicIds = topics.Select(x => x.Id).ToList();

            // Gets posts for topics
            var posts        = postService.GetPostsByTopics(topicIds, allowedGroups);
            var groupedPosts = posts.ToLookup(x => x.Topic.Id);

            // Get all permissions
            var permissions = GetPermissionsForTopics(topics, roleService, usersRole);

            // Get all votes
            var votesGrouped = voteService.GetVotesByTopicsGroupedIntoPosts(topicIds);

            // Favourites grouped
            var favouritesGrouped = favouriteService.GetByTopicsGroupedIntoPosts(topicIds);

            // Create the view models
            var viewModels = new List <TopicViewModel>();

            foreach (var topic in topics)
            {
                var id         = topic.Id;
                var permission = permissions[topic.Group];
                var topicPosts = groupedPosts.Contains(id) ? groupedPosts[id].ToList() : new List <Post>();

                var votes = new Dictionary <Guid, List <Vote> >();
                if (votesGrouped.ContainsKey(id))
                {
                    votes = votesGrouped[id];
                }

                var favourites = new Dictionary <Guid, List <Favourite> >();
                if (favouritesGrouped.ContainsKey(id))
                {
                    favourites = favouritesGrouped[id];
                }

                var postIds = topicPosts.Select(x => x.Id).ToList();

                viewModels.Add(CreateTopicViewModel(topic, permission, topicPosts, postIds, null, null, null, null, loggedOnUser,
                                                    settings, topicNotificationService, pollService, votes, favourites));
            }
            return(viewModels);
        }
コード例 #14
0
 public JokeCategoryViewModel(
     IHttpService <ChuckJoke, ChuckMessage> httpService,
     INavigationService navigationService,
     IFavouriteService <ChuckJoke> favouriteService)
     : base(navigationService)
 {
     this.httpService      = httpService;
     this.favouriteService = favouriteService;
     NextJokeCommand       = new Command(GetCategoryJoke);
 }
コード例 #15
0
 public FavouriteController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService,
                            IRoleService roleService, ITopicService topicService, IPostService postService,
                            ILocalizationService localizationService, ISettingsService settingsService,
                            IFavouriteService favouriteService, ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService, cacheService)
 {
     _topicService     = topicService;
     _postService      = postService;
     _favouriteService = favouriteService;
 }
コード例 #16
0
 public FavouriteController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService,
     IRoleService roleService, ITopicService topicService, IPostService postService,
     ILocalizationService localizationService, ISettingsService settingsService, 
     IFavouriteService favouriteService, ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService, cacheService)
 {
     _topicService = topicService;
     _postService = postService;
     _favouriteService = favouriteService;
 }
コード例 #17
0
        public FavouriteRestaurantsControllerTests()
        {
            this.dbContext = MockDbContext.GetContext();

            this.restaurantRepository = new EfDeletableEntityRepository <Restaurant>(this.dbContext);
            this.favouriteRepository  = new EfRepository <FavouriteRestaurant>(this.dbContext);

            this.favouriteService = new FavouriteService(this.favouriteRepository);

            this.controller = new FavouriteRestaurantsController(this.favouriteService);
        }
コード例 #18
0
 public PostDeletePipe(IVoteService voteService, IMembershipUserPointsService membershipUserPointsService, IUploadedFileService uploadedFileService, IFavouriteService favouriteService, IPostEditService postEditService, ILoggingService loggingService, IRoleService roleService, ILocalizationService localizationService)
 {
     _voteService = voteService;
     _membershipUserPointsService = membershipUserPointsService;
     _uploadedFileService         = uploadedFileService;
     _favouriteService            = favouriteService;
     _postEditService             = postEditService;
     _loggingService      = loggingService;
     _roleService         = roleService;
     _localizationService = localizationService;
 }
コード例 #19
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="loggingService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="postService"> </param>
 /// <param name="membershipService"> </param>
 /// <param name="localizationService"></param>
 /// <param name="roleService"> </param>
 /// <param name="settingsService"> </param>
 /// <param name="favouriteService"></param>
 /// <param name="cacheService"></param>
 /// <param name="context"></param>
 public BadgeController(ILoggingService loggingService, IBadgeService badgeService, IPostService postService,
                        IMembershipService membershipService, ILocalizationService localizationService, IRoleService roleService,
                        ISettingsService settingsService, IFavouriteService favouriteService, ICacheService cacheService,
                        IMvcForumContext context)
     : base(loggingService, membershipService, localizationService, roleService,
            settingsService, cacheService, context)
 {
     _badgeService     = badgeService;
     _postService      = postService;
     _favouriteService = favouriteService;
 }
コード例 #20
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;
 }
コード例 #21
0
 public SearchController(ILoggingService loggingService, IMembershipService membershipService,
                         ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService,
                         IPostService postService, IVoteService voteService, IFavouriteService favouriteService,
                         ICategoryService categoryService, ICacheService cacheService, IMvcForumContext context)
     : base(loggingService, membershipService, localizationService, roleService,
            settingsService, cacheService, context)
 {
     _postService      = postService;
     _voteService      = voteService;
     _favouriteService = favouriteService;
     _categoryService  = categoryService;
 }
コード例 #22
0
 public SearchController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager,
                         IMembershipService membershipService, ILocalizationService localizationService,
                         IRoleService roleService, ISettingsService settingsService,
                         IPostService postService, IVoteService voteService, IFavouriteService favouriteService,
                         ICategoryService categoryService, ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService, cacheService)
 {
     _postService      = postService;
     _voteService      = voteService;
     _favouriteService = favouriteService;
     _categoryService  = categoryService;
 }
コード例 #23
0
ファイル: BadgeController.cs プロジェクト: yaobos/mvcforum
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="badgeService"> </param>
 /// <param name="loggingService"> </param>
 /// <param name="unitOfWorkManager"> </param>
 /// <param name="postService"> </param>
 /// <param name="membershipService"> </param>
 /// <param name="localizationService"></param>
 /// <param name="roleService"> </param>
 /// <param name="settingsService"> </param>
 /// <param name="favouriteService"></param>
 public BadgeController(ILoggingService loggingService,
                        IUnitOfWorkManager unitOfWorkManager,
                        IBadgeService badgeService,
                        IPostService postService,
                        IMembershipService membershipService,
                        ILocalizationService localizationService, IRoleService roleService,
                        ISettingsService settingsService, IFavouriteService favouriteService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _badgeService     = badgeService;
     _postService      = postService;
     _favouriteService = favouriteService;
 }
コード例 #24
0
        public JokeResultViewModel(
            IHttpService <ChuckJoke, ChuckMessage> httpService,
            INavigationService navigationService,
            IFavouriteService <ChuckJoke> favouriteService)
            : base(navigationService)
        {
            this.httpService      = httpService;
            this.favouriteService = favouriteService;

            SearchCommand    = new Command(OnSearchCommand);
            GoBackCommand    = new Command(OnGoBackCommand);
            FavouriteCommand = new Command <ChuckJoke>(OnFavouriteCommand);
        }
コード例 #25
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="badgeService"> </param>
 /// <param name="loggingService"> </param>
 /// <param name="unitOfWorkManager"> </param>
 /// <param name="postService"> </param>
 /// <param name="membershipService"> </param>
 /// <param name="localizationService"></param>
 /// <param name="roleService"> </param>
 /// <param name="settingsService"> </param>
 /// <param name="favouriteService"></param>
 public BadgeController(ILoggingService loggingService,
     IUnitOfWorkManager unitOfWorkManager,
     IBadgeService badgeService,
     IPostService postService,
     IMembershipService membershipService,
     ILocalizationService localizationService, IRoleService roleService,
     ISettingsService settingsService, IFavouriteService favouriteService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _badgeService = badgeService;
     _postService = postService;
     _favouriteService = favouriteService;
 }
コード例 #26
0
 public RandomJokeViewModel(
     IHttpService <ChuckJoke, ChuckMessage> httpService,
     INavigationService navigationService,
     IFavouriteService <ChuckJoke> favouriteService)
     : base(navigationService)
 {
     this.httpService      = httpService;
     this.favouriteService = favouriteService;
     BackCommand           = new Command(OnBackCommand);
     NextJokeCommand       = new Command(NextJoke);
     FavouriteCommand      = new Command <ChuckJoke>(OnFavouriteCommand);
     Initialize();
 }
コード例 #27
0
 public RestaurantsController(
     IRestaurantService restaurantService,
     ICategoryService categoryService,
     IUserService userService,
     IConfiguration configuration,
     IFavouriteService favouriteService)
     : base(userService)
 {
     this.restaurantService = restaurantService;
     this.categoryService   = categoryService;
     this.userService       = userService;
     this.configuration     = configuration;
     this.favouriteService  = favouriteService;
 }
コード例 #28
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;
 }
コード例 #29
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;
 }
コード例 #30
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();
        }
コード例 #31
0
 public MemeService(
     IMemeRepository _memeRepository,
     IValidator <Meme> validator,
     UserManager <PageUser> userManager,
     ICategoryService categoryService,
     ICommentService commentService,
     IVoteService voteService,
     IFavouriteService favouriteService) : base(_memeRepository, validator)
 {
     _userManager      = userManager;
     _categoryService  = categoryService;
     _commentService   = commentService;
     _voteService      = voteService;
     _favouriteService = favouriteService;
 }
コード例 #32
0
ファイル: PostService.cs プロジェクト: ivanchen52/mvcforum
 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;
 }
コード例 #33
0
ファイル: SearchController.cs プロジェクト: Xamarui/mvcforum
        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();
        }
コード例 #34
0
 public TopicService(IMvcForumContext context, IMembershipUserPointsService membershipUserPointsService,
                     ISettingsService settingsService, INotificationService notificationService,
                     IFavouriteService favouriteService,
                     IPostService postService, IRoleService roleService, IPollService pollService, ICacheService cacheService, ILoggingService loggingService)
 {
     _membershipUserPointsService = membershipUserPointsService;
     _settingsService             = settingsService;
     _notificationService         = notificationService;
     _favouriteService            = favouriteService;
     _postService    = postService;
     _roleService    = roleService;
     _pollService    = pollService;
     _cacheService   = cacheService;
     _loggingService = loggingService;
     _context        = context;
 }
コード例 #35
0
 public TopicService(IMVCForumContext context, IMembershipUserPointsService membershipUserPointsService,
                     ISettingsService settingsService, ITopicNotificationService topicNotificationService,
                     IFavouriteService favouriteService,
                     IPostService postService, IRoleService roleService, IPollService pollService, IPollAnswerService pollAnswerService, ICacheService cacheService)
 {
     _membershipUserPointsService = membershipUserPointsService;
     _settingsService             = settingsService;
     _topicNotificationService    = topicNotificationService;
     _favouriteService            = favouriteService;
     _postService       = postService;
     _roleService       = roleService;
     _pollService       = pollService;
     _pollAnswerService = pollAnswerService;
     _cacheService      = cacheService;
     _context           = context as MVCForumContext;
 }
コード例 #36
0
ファイル: TopicService.cs プロジェクト: lenwen/mvcforum
 public TopicService(IMVCForumContext context, IMembershipUserPointsService membershipUserPointsService,
     ISettingsService settingsService, ITopicNotificationService topicNotificationService,
     IFavouriteService favouriteService,
     IPostService postService, IRoleService roleService, IPollService pollService, IPollAnswerService pollAnswerService, ICacheService cacheService)
 {
     _membershipUserPointsService = membershipUserPointsService;
     _settingsService = settingsService;
     _topicNotificationService = topicNotificationService;
     _favouriteService = favouriteService;
     _postService = postService;
     _roleService = roleService;
     _pollService = pollService;
     _pollAnswerService = pollAnswerService;
     _cacheService = cacheService;
     _context = context as MVCForumContext;
 }
コード例 #37
0
ファイル: PostService.cs プロジェクト: nhsengland/futurenhs
 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;
 }
コード例 #38
0
ファイル: TopicController.cs プロジェクト: jbp3/mvcforum
 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;
 }
コード例 #39
0
ファイル: UserScrubPipe.cs プロジェクト: zhyqhb/mvcforum
 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;
 }
コード例 #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, 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;
 }
コード例 #41
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;
 }
コード例 #42
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));
 }
コード例 #43
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();
        }
コード例 #44
0
 public RouteController(IAccountService accountService, IRouteService routeService, IFavouriteService favouriteService)
     : base(accountService)
 {
     _routeService = routeService;
     _favouriteService = favouriteService;
 }