예제 #1
0
 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));
 }
예제 #2
0
 public DataAccessRepository(Identifier table, IDbConnectionFactory connectionFactory, IInformationSchemaRepository infoRepository = null)
     : this(new RepositoryConfiguration {
     Table = table
 }, connectionFactory, infoRepository)
 {
 }