public DocumentDbQueryProvider(DocumentDbMetadata dbMetadata, string connectionString, string collectionName, Type collectionType) { this.dbContext = new DocumentDbContext(connectionString); this.dbMetadata = dbMetadata; this.connectionString = connectionString; this.collectionName = collectionName; this.collectionType = collectionType; }
public QueryExpressionVisitor(DocumentClient documentClient, DocumentCollection documentCollection, DocumentDbMetadata dbMetadata, Type queryDocumentType) { var genericMethod = typeof(DocumentQueryable).GetMethods() .Where(x => x.Name == "CreateDocumentQuery" && x.GetParameters().Length == 3 && x.ReturnType.GenericTypeArguments.First().IsGenericParameter) .Single(); var method = genericMethod.MakeGenericMethod(queryDocumentType); _queryableCollection = method.Invoke(null, new object[] { documentClient, documentCollection.DocumentsLink, null }) as IQueryable; _collectionType = queryDocumentType; _dbMetadata = dbMetadata; }
public DocumentDbQueryableResource(DocumentDbMetadata dbMetadata, string connectionString, string collectionName, Type collectionType) { this._documentDbMetadata = dbMetadata; this.provider = new DocumentDbQueryProvider(dbMetadata, connectionString, collectionName, collectionType); this.expression = (new DSPResource[0]).AsQueryable().Expression; }