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