コード例 #1
0
ファイル: RoleService.cs プロジェクト: ivanchen52/mvcforum
 public RoleService(IMVCForumContext context, ICategoryPermissionForRoleService categoryPermissionForRoleService, IPermissionService permissionService, IGlobalPermissionForRoleService globalPermissionForRoleService)
 {
     _categoryPermissionForRoleService = categoryPermissionForRoleService;
     _permissionService = permissionService;
     _globalPermissionForRoleService = globalPermissionForRoleService;
     _context = context as MVCForumContext;
 }
コード例 #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;
 }
コード例 #3
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;
 }
コード例 #4
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);
 }
コード例 #5
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;
 }
コード例 #6
0
ファイル: TopicService.cs プロジェクト: ivanchen52/mvcforum
 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;
 }
コード例 #7
0
ファイル: UnitOfWork.cs プロジェクト: ivanchen52/mvcforum
        /// <summary>
        /// Constructor
        /// </summary>
        public UnitOfWork(MVCForumContext context)
        {            
            _context = context;

            // In order to make calls that are overidden in the caching ef-wrapper, we need to use
            // transactions from the connection, rather than TransactionScope. 
            // This results in our call e.g. to commit() being intercepted 
            // by the wrapper so the cache can be adjusted.
            // This won't work with the dbcontext because it handles the connection itself, so we must use the underlying ObjectContext. 
            // http://blogs.msdn.com/b/diego/archive/2012/01/26/exception-from-dbcontext-api-entityconnection-can-only-be-constructed-with-a-closed-dbconnection.aspx
            _objectContext = ((IObjectContextAdapter) _context).ObjectContext;

            // Updating EF timeout taken from
            // http://stackoverflow.com/questions/6232633/entity-framework-timeouts
            //_objectContext.CommandTimeout = 3 * 60; // value in seconds

            if (_objectContext.Connection.State != ConnectionState.Open)
            {
                _objectContext.Connection.Open();
                _transaction = _objectContext.Connection.BeginTransaction();
            }
        }
コード例 #8
0
ファイル: VoteService.cs プロジェクト: ivanchen52/mvcforum
 public VoteService(IMVCForumContext context, IMembershipUserPointsService membershipUserPointsService)
 {
     _membershipUserPointsService = membershipUserPointsService;
     _context = context as MVCForumContext;
 }
コード例 #9
0
ファイル: EmailService.cs プロジェクト: ivanchen52/mvcforum
 public EmailService(ILoggingService loggingService, ISettingsService settingsService, IMVCForumContext context)
 {
     _loggingService = loggingService;
     _settingsService = settingsService;
     _context = context as MVCForumContext;
 }
コード例 #10
0
 public UploadedFileService(MVCForumContext context)
 {
     _context = context;
 }
コード例 #11
0
ファイル: BlockService.cs プロジェクト: ivanchen52/mvcforum
 public BlockService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #12
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;
 }
コード例 #13
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ActivityService(IBadgeService badgeService, ILoggingService loggingService, IMVCForumContext context)
 {
     _badgeService = badgeService;
     _loggingService = loggingService;
     _context = context as MVCForumContext;
 }
コード例 #14
0
 public BannedWordService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #15
0
 public CategoryNotificationService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #16
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 /// <param name="cacheService"></param>
 public SettingsService(IMVCForumContext context, ICacheService cacheService)
 {
     _cacheService = cacheService;
     _context = context as MVCForumContext;
 }
コード例 #17
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public CategoryPermissionForRoleService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #18
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public TagNotificationService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #19
0
 public MembershipUserPointsService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #20
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;
 }
コード例 #21
0
 public PostEditService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #22
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public PrivateMessageService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #23
0
 public PollVoteService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #24
0
 public BannedEmailService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #25
0
 public GlobalPermissionForRoleService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #26
0
 public FavouriteService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
コード例 #27
0
 public PermissionService(ICategoryPermissionForRoleService categoryPermissionForRoleService, IMVCForumContext context)
 {
     _categoryPermissionForRoleService = categoryPermissionForRoleService;
     _context = context as MVCForumContext;
 }
コード例 #28
0
 public PollAnswerService(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }