Esempio n. 1
0
 public DynamoDbSet(
     IIndexExtractor indexExtractor,
     ITableNameExtractor tableNameExtractor,
     IPrimaryKeyExtractor primaryKeyExtractor,
     IEntityValidator validator,
     IDynamoContextOptionsProvider optionsProvider,
     IEntityConfigurationProvider entityConfigurationProvider,
     Type contextType)
 {
     this.contextOptions      = optionsProvider.GetContextOptions(contextType);
     this.Client              = this.contextOptions.AwsOptions.CreateServiceClient <IAmazonDynamoDB>();
     this.Base                = new DynamoDBContext(this.Client);
     this.indexExtractor      = indexExtractor;
     this.tableNameExtractor  = tableNameExtractor;
     this.primaryKeyExtractor = primaryKeyExtractor;
     this.validator           = validator;
     this.table               = this.Base.TryGetTargetTable <TEntity>(this.operationConfig);
     this.entityConfig        = entityConfigurationProvider.GetEntityConfiguration(
         this.contextOptions.ContextType, typeof(TEntity)) as IEntityConfiguration <TEntity>;
     this.operationConfig = new DynamoDBOperationConfig
     {
         OverrideTableName = this.tableNameExtractor.ExtractTableName(
             this.contextOptions, this.entityConfig, this.table),
         Conversion = this.contextOptions.Conversion ?? DynamoDBEntryConversion.V1
     };
 }
Esempio n. 2
0
 public DatabaseFacade(
     ITableNameExtractor tableNameExtractor,
     ITableCreator tableCreator,
     ITableDropper tableDropper,
     IDynamoContextOptionsProvider optionsProvider,
     Type contextType)
 {
     this.options            = optionsProvider.GetContextOptions(contextType);
     this.tableNameExtractor = tableNameExtractor;
     this.tableCreator       = tableCreator;
     this.tableDropper       = tableDropper;
 }