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; }
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; }
public SimpleDbContextProvider(IDbContextStorage dbContextStorage) { _dbContextStorage = dbContextStorage; }
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)); }
public Repository(IDbContextStorage contextStorage) : base(contextStorage) { }
public GenericRepository(IDbContextStorage contextStorage) { this._contextStorage = contextStorage; }