public IntegrationTests() { connectionFactory = new ConfiguredSqlConnectionFactory("dev"); var infoRepo = new SchemaDataAccess(connectionFactory); var config = new RepositoryConfiguration { Table = new Identifier("dbo", "REGION") }; repo = new DataAccessRepository <Region>(config, connectionFactory, infoRepo); }
public DataAccessRepository(RepositoryConfiguration config, IDbConnectionFactory connectionFactory, IInformationSchemaRepository infoRepository = null) { if (config == null) { throw new ArgumentNullException(nameof(config)); } if (config.Table == Identifier.Empty) { throw new ArgumentException($"config {nameof(config.Table)} must not be null"); } if (connectionFactory == null) { throw new ArgumentNullException(nameof(connectionFactory)); } if (infoRepository == null) { infoRepository = new SchemaDataAccess(connectionFactory); } this.config = config; this.connectionFactory = connectionFactory; lazyTable = new Lazy <Task <TableSchema> >(() => infoRepository.TableSchemaAsync(config.Table)); }