Esempio n. 1
0
        public UnitOfWorkManager(IMVCForumContext context)
        {
            // http://stackoverflow.com/questions/3552000/entity-framework-code-only-error-the-model-backing-the-context-has-changed-sinc
            Database.SetInitializer <MVCForumContext>(null);

            _context = context as MVCForumContext;
        }
Esempio n. 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="roleService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="categoryPermissionForRoleService"></param>
 public CategoryService(IMVCForumContext context, IRoleService roleService, ICategoryNotificationService categoryNotificationService, ICategoryPermissionForRoleService categoryPermissionForRoleService)
 {
     _roleService = roleService;
     _categoryNotificationService = categoryNotificationService;
     _categoryPermissionForRoleService = categoryPermissionForRoleService;
     _context = context as MVCForumContext;
 }
Esempio n. 3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="roleService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="categoryPermissionForRoleService"></param>
 public CategoryService(IMVCForumContext context, IRoleService roleService, ICategoryNotificationService categoryNotificationService, ICategoryPermissionForRoleService categoryPermissionForRoleService)
 {
     _roleService = roleService;
     _categoryNotificationService      = categoryNotificationService;
     _categoryPermissionForRoleService = categoryPermissionForRoleService;
     _context = context as MVCForumContext;
 }
Esempio n. 4
0
 public RoleService(IMVCForumContext context, ICategoryPermissionForRoleService categoryPermissionForRoleService, IPermissionService permissionService, IGlobalPermissionForRoleService globalPermissionForRoleService)
 {
     _categoryPermissionForRoleService = categoryPermissionForRoleService;
     _permissionService = permissionService;
     _globalPermissionForRoleService = globalPermissionForRoleService;
     _context = context as MVCForumContext;
 }
Esempio n. 5
0
 public RoleService(IMVCForumContext context, ICategoryPermissionForRoleService categoryPermissionForRoleService, IPermissionService permissionService, IGlobalPermissionForRoleService globalPermissionForRoleService)
 {
     _categoryPermissionForRoleService = categoryPermissionForRoleService;
     _permissionService = permissionService;
     _globalPermissionForRoleService = globalPermissionForRoleService;
     _context = context as MVCForumContext;
 }
Esempio n. 6
0
        public UnitOfWorkManager(IMVCForumContext context)
        {
            // http://stackoverflow.com/questions/3552000/entity-framework-code-only-error-the-model-backing-the-context-has-changed-sinc
            Database.SetInitializer<MVCForumContext>(null);

            _context = context as MVCForumContext;
        }
Esempio n. 7
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;
 }
Esempio n. 8
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;
 }
Esempio n. 9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="topicService"></param>
 /// <param name="categoryService"></param>
 /// <param name="badgeService"></param>
 public TopicTagService(IMVCForumContext context, ITopicService topicService, ICategoryService categoryService, IBadgeService badgeService)
 {
     _topicService = topicService;
     _categoryService = categoryService;
     _badgeService = badgeService;
     _context = context as MVCForumContext;
 }
Esempio n. 10
0
 public UnitOfWorkManager(IMVCForumContext context)
 {
     //http://www.entityframeworktutorial.net/code-first/automated-migration-in-code-first.aspx
     Database.SetInitializer(new MigrateDatabaseToLatestVersion<MVCForumContext, Migrations.Configuration>(AppConstants.MvcForumContext));
     //Database.SetInitializer<MVCForumContext>(null);
     _context = context as MVCForumContext;
 }
Esempio n. 11
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="topicService"></param>
 /// <param name="categoryService"></param>
 /// <param name="badgeService"></param>
 public TopicTagService(IMVCForumContext context, ITopicService topicService, ICategoryService categoryService, IBadgeService badgeService)
 {
     _topicService    = topicService;
     _categoryService = categoryService;
     _badgeService    = badgeService;
     _context         = context as MVCForumContext;
 }
Esempio n. 12
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ActivityService(IBadgeService badgeService, ILoggingService loggingService, IMVCForumContext context, ICacheService cacheService)
 {
     _badgeService = badgeService;
     _loggingService = loggingService;
     _cacheService = cacheService;
     _context = context as MVCForumContext;
 }
Esempio n. 13
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settingsService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="cacheService"></param>
 /// <param name="context"></param>
 public LocalizationService(ISettingsService settingsService, ILoggingService loggingService, ICacheService cacheService, IMVCForumContext context)
 {
     _settingsService = settingsService;
     _loggingService = loggingService;
     _cacheService = cacheService;
     _context = context as MVCForumContext;
     _perRequestLanguageStrings = ResourceKeysByLanguage(CurrentLanguage);
 }
Esempio n. 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;
 }
Esempio n. 15
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;
 }
Esempio n. 16
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;
 }
Esempio n. 17
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;
 }
Esempio n. 18
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 /// <param name="cacheService"></param>
 public PrivateMessageService(IMVCForumContext context, ICacheService cacheService)
 {
     _cacheService = cacheService;
     _context      = context as MVCForumContext;
 }
Esempio n. 19
0
 public EmailService(ILoggingService loggingService, ISettingsService settingsService, IMVCForumContext context)
 {
     _loggingService = loggingService;
     _settingsService = settingsService;
     _context = context as MVCForumContext;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public TopicNotificationRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 21
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public ActivityRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public PrivateMessageRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public CategoryPermissionForRoleRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 24
0
 public FavouriteRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 25
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public VoteRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 26
0
 public RecruitmentService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 27
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public ActivityRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 28
0
 public EmailRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
 public CategoryNotificationRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 30
0
 public UnitOfWorkManager(IMVCForumContext context)
 {
     //http://www.entityframeworktutorial.net/code-first/automated-migration-in-code-first.aspx
     Database.SetInitializer(new MigrateDatabaseToLatestVersion <MVCForumContext, Configuration>(SiteConstants.Instance.MvcForumContext));
     _context = context as MVCForumContext;
 }
Esempio n. 31
0
 public FavouriteRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 32
0
 public PermissionService(ICategoryPermissionForRoleService categoryPermissionForRoleService, IMVCForumContext context)
 {
     _categoryPermissionForRoleService = categoryPermissionForRoleService;
     _context = context as MVCForumContext;
 }
Esempio n. 33
0
 public ImageService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 34
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public TopicNotificationService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 35
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public TopicNotificationService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 36
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ActivityService(IBadgeService badgeService, ILoggingService loggingService, IMVCForumContext context, ICacheService cacheService)
 {
     _badgeService   = badgeService;
     _loggingService = loggingService;
     _cacheService   = cacheService;
     _context        = context as MVCForumContext;
 }
Esempio n. 37
0
 public PollVoteService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 38
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public LocalizationRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 39
0
 public BannerService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 40
0
 public BlockService(IMVCForumContext context, ICacheService cacheService)
 {
     _cacheService = cacheService;
     _context = context as MVCForumContext;
 }
Esempio n. 41
0
 public VoteService(IMVCForumContext context, IMembershipUserPointsService membershipUserPointsService)
 {
     _membershipUserPointsService = membershipUserPointsService;
     _context = context as MVCForumContext;
 }
Esempio n. 42
0
 public OnePosService(IMVCForumContext context, ICacheService cacheService)
 {
     _context      = context as MVCForumContext;
     _cacheService = cacheService;
 }
Esempio n. 43
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public CategoryPermissionForRoleRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 44
0
 public InstallerRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 45
0
 public InstallerRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 46
0
 public EmailRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 47
0
 public PollAnswerRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 48
0
 public BlockService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 49
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public MembershipRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 50
0
 public PostEditService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 51
0
 public PermissionRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 52
0
 public PollVoteService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 53
0
        //private void PopulatePostsVotes(List<Topic> results)
        //{
        //    // Get Topics Ids
        //    var topicIds = results.Select(x => x.Id);

        //    // Get all posts for these topics in one hit
        //    var posts = _context.Post.Include(x => x.Topic).AsNoTracking().Where(x => topicIds.Contains(x.Topic.Id)).ToList();

        //    // Get the ids of the posts
        //    var postIds = posts.Select(x => x.Id);

        //    // Use the ids to get all the post votes
        //    var votes = _context.Vote.Include(x => x.Post).AsNoTracking().Where(x => postIds.Contains(x.Post.Id)).ToList();

        //    foreach (var topic in results)
        //    {
        //        var topicPosts = posts.Where(x => x.Topic.Id == topic.Id).ToList();
        //        topic.Posts = topicPosts;
        //        if (topic.Posts.Any())
        //        {
        //            PopulateVotes(topic.Posts, voteGroups);
        //        }
        //    }
        //}

        //private void PopulateVotes(IList<Post> posts, List<IGrouping<Guid, Vote>> votes)
        //{
        //    foreach (var post in posts)
        //    {
        //        var voteGroup = votes.FirstOrDefault(x => x.Key == post.Id);
        //        post.Votes = voteGroup == null ? new List<Vote>() : voteGroup.ToList();
        //    }
        //}

        #endregion

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="context"> </param>
        public TopicRepository(IMVCForumContext context)
        {
            _context = context as MVCForumContext;
        }
Esempio n. 54
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public SettingsRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 55
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 /// <param name="cacheService"></param>
 public PrivateMessageService(IMVCForumContext context, ICacheService cacheService)
 {
     _cacheService = cacheService;
     _context = context as MVCForumContext;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public TopicNotificationRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 57
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public MembershipRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 58
0
 public BannedWordService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 59
0
 public PostRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Esempio n. 60
0
 public PermissionService(ICategoryPermissionForRoleService categoryPermissionForRoleService, IMVCForumContext context)
 {
     _categoryPermissionForRoleService = categoryPermissionForRoleService;
     _context = context as MVCForumContext;
 }