/// <summary>
 /// Initializes a new instance of the <see cref="EntityFrameworkUnitOfWorkProvider"/> class.
 /// </summary>
 public EntityFrameworkUnitOfWorkProvider(IUnitOfWorkRegistry registry, Func <string, DatabaseType, DbContext> dbContextFactory) : base(registry)
 {
     _dbContextFactory = dbContextFactory;
 }
        public ApplicationUnitOfWorkProvider(IUnitOfWorkRegistry registry, Func<DbContext> factory) : base(registry, factory)
        {

        }
        /// <summary>
        /// Initializes a new instance of the <see cref="UnitOfWorkProviderBase"/> class.
        /// </summary>
        protected UnitOfWorkProviderBase(IUnitOfWorkRegistry registry)
        {
            Validations.ValidateInput(registry, nameof(registry));

            _registry = registry;
        }
예제 #4
0
 public UnitOfWorkProviderBaseStub(IUnitOfWorkRegistry registry, Func <IUnitOfWork> newUnitOfWorkFactory) : base(registry)
 {
     this.newUnitOfWorkFactory = newUnitOfWorkFactory;
 }
 public UnitOfWorkRegistryBase(IUnitOfWorkRegistry alternateRegistry = null)
 {
     this.alternateRegistry = alternateRegistry;
 }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnitOfWorkProviderBase"/> class.
 /// </summary>
 protected UnitOfWorkProviderBase(IUnitOfWorkRegistry registry)
 {
     this.registry = registry;
 }
예제 #7
0
 protected static UnitOfWorkProviderBase CreateUnitOfWorkProviderStub(IUnitOfWork newUnitOfWork, IUnitOfWorkRegistry unitOfWorkRegistry = null)
 {
     return(CreateUnitOfWorkProviderStub(() => newUnitOfWork, unitOfWorkRegistry));
 }
 public ApplicationUnitOfWorkProvider(IUnitOfWorkRegistry registry, Func <DbContext> factory) : base(registry, factory)
 {
 }
예제 #9
0
 public AppEntityFrameworkUnitOfWorkProvider(IUnitOfWorkRegistry registry, Func <MtgDbContext> dbContextFactory)
     : base(registry, dbContextFactory)
 {
 }
 public AspNetCoreUnitOfWorkRegistry(IHttpContextAccessor httpContextAccessor, IUnitOfWorkRegistry alternateRegistry = null) : base(alternateRegistry)
 {
     this.httpContextAccessor = httpContextAccessor;
 }
예제 #11
0
 protected AUnitOfWorkFactory(IUnitOfWorkRegistry registry)
 {
     _registry = registry;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityFrameworkUnitOfWorkProvider"/> class.
 /// </summary>
 protected EntityFrameworkUnitOfWorkProvider(IUnitOfWorkRegistry registry, Func <DbContext> dbContextFactory) : base(registry)
 {
     this.dbContextFactory = dbContextFactory;
 }
예제 #13
0
        public NativeUnitOfWorkProvider(IUnitOfWorkRegistry registry, Func <string, DatabaseType, IDbConnection> connectionFactory) : base(registry)
        {
            Validations.ValidateInput(connectionFactory, nameof(connectionFactory));

            _connectionFactory = connectionFactory;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TableStorageUnitOfWorkProvider"/> class.
 /// </summary>
 public TableStorageUnitOfWorkProvider(IUnitOfWorkRegistry registry, Func <ITableStorageContext> contextFactory) : base(registry)
 {
     this.contextFactory = contextFactory;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityFrameworkUnitOfWorkProvider"/> class.
 /// </summary>
 public EntityFrameworkUnitOfWorkProvider(IUnitOfWorkRegistry registry, Func<DbContext> dbContextFactory) : base(registry)
 {
     this.dbContextFactory = dbContextFactory;
 }
예제 #16
0
 public TableStorageRepositoryTests()
 {
     uowRegistry = new ThreadLocalUnitOfWorkRegistry();
 }
예제 #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnitOfWorkProviderBase"/> class.
 /// </summary>
 public UnitOfWorkProviderBase(IUnitOfWorkRegistry registry)
 {
     this.registry = registry;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UnitOfWorkProviderBase"/> class.
 /// </summary>
 public UnitOfWorkProviderBase(IUnitOfWorkRegistry registry)
 {
     this.registry = registry;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityFrameworkUnitOfWorkProvider"/> class.
 /// </summary>
 public EntityFrameworkUnitOfWorkProvider(IUnitOfWorkRegistry registry, Func <AppDbContext> dbContextFactory) : base(registry)
 {
     _dbContextFactory = dbContextFactory;
 }
예제 #20
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="connectionOptions">connection options</param>
 /// <param name="registry">Storage for unitOfWork instances</param>
 public ExpenseManagerUnitOfWorkProvider(ConnectionOptions connectionOptions,
                                         IUnitOfWorkRegistry registry)
     : base(registry)
 {
     ConnectionOptions = connectionOptions;
 }
예제 #21
0
 protected static UnitOfWorkProviderBase CreateUnitOfWorkProviderStub(Func <IUnitOfWork> newUnitOfWorkFactory = null, IUnitOfWorkRegistry unitOfWorkRegistry = null)
 {
     unitOfWorkRegistry   = unitOfWorkRegistry ?? CreateUnitOfWorkRegistryStub();
     newUnitOfWorkFactory = newUnitOfWorkFactory ?? (() => new Mock <IUnitOfWork>().Object);
     return(new UnitOfWorkProviderBaseStub(unitOfWorkRegistry, newUnitOfWorkFactory));
 }
예제 #22
0
 /// <summary>
 /// Alternative variant with db context factory for injecting custom Db Context (currently used for testing)
 /// </summary>
 /// <param name="dbContextFactory">db context factory</param>
 /// <param name="registry">Storage for unitOfWork instances</param>
 internal ExpenseManagerUnitOfWorkProvider(Func <DbContext> dbContextFactory, IUnitOfWorkRegistry registry)
     : base(registry)
 {
     DbContextFactory = dbContextFactory;
 }
예제 #23
0
 public AppUnitOfWorkProvider(
     IUnitOfWorkRegistry registry,
     Func <PhotoBoothContext> dbContextFactory)
     : base(registry, dbContextFactory)
 {
 }
예제 #24
0
 public EntityFrameworkUnitOfWorkFactory(IEntityFrameworkDbContextFactory dbContextFactory, IUnitOfWorkRegistry registry) : base(registry)
 {
     _dbContextFactory = dbContextFactory;
 }