Пример #1
0
 public UnitOfWork(
     IDbContextStorage contextStorage,
     IExceptionHandler exceptionHandler)
 {
     this.contextStorage   = contextStorage;
     this.exceptionHandler = exceptionHandler;
 }
Пример #2
0
 public static void InitStorage(IDbContextStorage storage)
 {
     if(storage == null)
         throw new ArgumentException("storage");
     
     Storage = storage;
 }
Пример #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;
 }
Пример #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;
 }
Пример #6
0
 public SimpleDbContextProvider(IDbContextStorage dbContextStorage)
 {
     _dbContextStorage = dbContextStorage;
 }
Пример #7
0
 public override void Init()
 {
     base.Init();
     _storage = _container.Resolve<IDbContextStorage>(new { app = this });
 }
Пример #8
0
 /// <summary>
 /// 初始化IDbContextStorage
 /// </summary>
 public static void InitStorage(IDbContextStorage storage)
 {
     _storage = storage;
 }
Пример #9
0
        public IEnumerable <DbContext> GetAllDbContexts()
        {
            IDbContextStorage storage = GetSimpleDbContextStorage();

            return(storage.GetAllDbContexts());
        }
Пример #10
0
        public void SetDbContextForKey(string factoryKey, DbContext context)
        {
            IDbContextStorage storage = GetSimpleDbContextStorage();

            storage.SetDbContextForKey(factoryKey, context);
        }
Пример #11
0
        public DbContext GetDbContextForKey(string key)
        {
            IDbContextStorage storage = GetSimpleDbContextStorage();

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