public WorkersAsyncService(IWorkerAsyncRepository repository,
                                   IDisposableUnitOfWorkFactory unitOfWorkFactory,
                                   IDbModelFactory modelFactory,
                                   IAsyncRepository <ContactInformation> contactsRepo,
                                   IAsyncRepository <Address> addressRepo)
            : base(repository, unitOfWorkFactory)
        {
            Guard.WhenArgument(repository, "IWorkerAsyncRepository").IsNull().Throw();
            Guard.WhenArgument(modelFactory, "modelFactory").IsNull().Throw();
            Guard.WhenArgument(contactsRepo, "contactsRepo").IsNull().Throw();
            Guard.WhenArgument(addressRepo, "addressRepo").IsNull().Throw();

            this.workerRepo   = repository;
            this.modelFactory = modelFactory;

            this.contactsRepo = contactsRepo;
            this.addressRepo  = addressRepo;
        }
Пример #2
0
 public DbContextFactory(IDbModelFactory dbModelFactory, IDataProviderFactory dataProviderFactory, ShellSettings shellSettings)
 {
     this.dbModelFactory      = dbModelFactory;
     this.dataProviderFactory = dataProviderFactory;
     connection = dataProviderFactory.CreateConnection(shellSettings.DataConnectionString);
 }
Пример #3
0
 public DefaultDbContext(DbConnection connection, IDbModelFactory dbModelFactory)
     : base(connection, dbModelFactory.GetDbCompiledModel <T>(connection))
 {
     Database.SetInitializer(new CreateTablesIfNotExist <DefaultDbContext <T> >());
 }