Example #1
0
        public UnitOfWork(ChamberContext 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();
            }
        }
Example #2
0
 public UnitOfWorkManager(IChamberContext context)
 {
     Database.SetInitializer(new MigrateDatabaseToLatestVersion <ChamberContext, Configuration>(SiteConstants.Instance.ChamberContext));
     _context = context as ChamberContext;
 }
Example #3
0
 public EmailService(ILoggingService loggingService, ISettingsService settingsService, IChamberContext context)
 {
     _loggingService  = loggingService;
     _settingsService = settingsService;
     _context         = context as ChamberContext;
 }
Example #4
0
 public ClassificationService(IChamberContext context, IActivityService activityService)
 {
     _context         = context as ChamberContext;
     _activityService = activityService;
 }
Example #5
0
 public BusinessService(IChamberContext context, IActivityService activityService, ISettingsService settingsService)
 {
     _context         = context as ChamberContext;
     _activityService = activityService;
     _settingsService = settingsService;
 }
Example #6
0
 public SettingsService(IChamberContext context, ICacheService cacheService)
 {
     _cacheService = cacheService;
     _context      = context as ChamberContext;
 }
Example #7
0
 public RoleService(IChamberContext context)
 {
     _context = context as ChamberContext;
 }
 public MembershipLevelService(IChamberContext context, IActivityService activityService)
 {
     _context         = context as ChamberContext;
     _activityService = activityService;
 }
Example #9
0
 public MembershipService(IChamberContext context, IActivityService activityService, ISettingsService settingsService)
 {
     _activityService = activityService;
     _settingsService = settingsService;
     _context         = context as ChamberContext;
 }
Example #10
0
 public ActivityService(ILoggingService loggingService, IChamberContext context)
 {
     _loggingService = loggingService;
     _context        = context as ChamberContext;
 }