Exemple #1
0
 public UnitOfWork(
     IDbContextStorage contextStorage,
     IExceptionHandler exceptionHandler)
 {
     this.contextStorage   = contextStorage;
     this.exceptionHandler = exceptionHandler;
 }
 public static void InitStorage(IDbContextStorage storage)
 {
     if(storage == null)
         throw new ArgumentException("storage");
     
     Storage = storage;
 }
Exemple #3
0
        public static void InitStorage(IDbContextStorage storage)
        {
            if (storage == null)
            {
                throw new ArgumentException("storage");
            }

            Storage = storage;
        }
 public static void InitStorage(IDbContextStorage storage) {
     if (storage == null) {
         throw new ArgumentNullException("storage");
     }
     if ((_storage != null) && (_storage != storage)) {
         throw new ApplicationException("A storage mechanism has already been configured for this application");
     }
     _storage = storage;
 }
Exemple #5
0
 public static void InitStorage(IDbContextStorage storage)
 {
     if (storage == null)
     {
         throw new ArgumentNullException("storage");
     }
     if ((_storage != null) && (_storage != storage))
     {
         throw new ApplicationException("A storage mechanism has already been configured for this application");
     }
     _storage = storage;
 }
 public SimpleDbContextProvider(IDbContextStorage dbContextStorage)
 {
     _dbContextStorage = dbContextStorage;
 }
Exemple #7
0
 public override void Init()
 {
     base.Init();
     _storage = _container.Resolve<IDbContextStorage>(new { app = this });
 }
 /// <summary>
 /// 初始化IDbContextStorage
 /// </summary>
 public static void InitStorage(IDbContextStorage storage)
 {
     _storage = storage;
 }
        public IEnumerable <DbContext> GetAllDbContexts()
        {
            IDbContextStorage storage = GetSimpleDbContextStorage();

            return(storage.GetAllDbContexts());
        }
        public void SetDbContextForKey(string factoryKey, DbContext context)
        {
            IDbContextStorage storage = GetSimpleDbContextStorage();

            storage.SetDbContextForKey(factoryKey, context);
        }
        public DbContext GetDbContextForKey(string key)
        {
            IDbContextStorage storage = GetSimpleDbContextStorage();

            return(storage.GetDbContextForKey(key));
        }
Exemple #12
0
 public Repository(IDbContextStorage contextStorage)
     : base(contextStorage)
 {
 }
Exemple #13
0
 public GenericRepository(IDbContextStorage contextStorage)
 {
     this._contextStorage = contextStorage;
 }