public AlphaRepository( IDbContextSession <PrimaryContext> session, IContextSettingsCacheService contextSettingsCacheService, IBulkInserterFactory bulkInserterFactory, ITableMappingCacheService tableMappingsCacheService) : base(session, contextSettingsCacheService, bulkInserterFactory, tableMappingsCacheService) { }
public PrimaryRepository( IDbContextSession <PrimaryContext> session, ITimeoutCacheService timeoutCacheService, IBulkInserterFactory bulkInserterFactory, ITableMappingsCacheService tableMappingsCacheService) : base(session, timeoutCacheService, bulkInserterFactory, tableMappingsCacheService) { }
protected BulkEnabledRepository( IDbContextSession <TContext> session, ITimeoutCacheService timeoutCacheService, ITableMappingsCacheService tableMappingsCacheService) : base(session) { this.tableMappingsCacheService = tableMappingsCacheService; this.timeoutCacheService = timeoutCacheService; this.session = session; }
protected BulkInsertRepository( IDbContextSession <TContext> session, IContextSettingsCacheService contextSettingsCacheService, IBulkInserterFactory bulkInserterFactory, ITableMappingCacheService tableMappingCacheService) : base(session, contextSettingsCacheService, tableMappingCacheService) { this.contextSettingsCacheService = contextSettingsCacheService; this.bulkInserterFactory = bulkInserterFactory; this.session = session; }
private TReturn PerformWork <TReturn>(Func <TReturn> unitOfWork, IDbContextSession <TContext> contextSession) { TReturn returnValue; if (contextSession.HasCurrentTransaction()) { returnValue = unitOfWork(); contextSession.CommitChanges(); } else { using (var transaction = contextSession.StartNewTransaction()) { try { returnValue = unitOfWork(); contextSession.CommitChanges(); transaction.Commit(); } catch { try { transaction.Rollback(); } catch { //swallow } try { contextSession.RevertChanges(); } catch { // swallow; } // throw original throw; } } } return(returnValue); }
private void PerformWork(Action unitOfWork, IDbContextSession <TContext> contextSession) { if (contextSession.HasCurrentTransaction()) { unitOfWork(); contextSession.CommitChanges(); } else { using (var transaction = contextSession.StartNewTransaction()) { try { unitOfWork(); contextSession.CommitChanges(); transaction.Commit(); } catch { try { transaction.Rollback(); } catch { //swallow } try { contextSession.RevertChanges(); } catch { // swallow; } // throw original throw; } } } }
protected SimpleGenericRepository( IDbContextSession <TContext> session) : base(session) { }
public Repository(IDbContextSession <TContext> session) { this.session = session; }
public SimplePrimaryRepository( IDbContextSession <PrimaryContext> session) : base(session) { }
public TReturn PerformUnitOfWork <TReturn>(Func <TReturn> unitOfWork, IDbContextSession <TContext> contextSession) { return(this.PerformWork(unitOfWork, contextSession)); }
public void PerformUnitOfWork(Action unitOfWork, IDbContextSession <TContext> contextSession) { this.PerformWork(unitOfWork, contextSession); }
public GenericTransactionService(IDbContextSession <TContext> session) { this.session = session; }