示例#1
0
        public IEnumerable <DynamicTableEntity> ExecuteQuery(TableQuery query, TableRequestOptions requestOptions = null,
                                                             OperationContext operationContext = null)
        {
            var parser           = new TableQueryParser();
            var filterExpression = parser.CreateFilterExpressionDynamic(query.FilterString).Compile();

            return(_entries.Where(filterExpression).AsEnumerable());
        }
示例#2
0
        public IEnumerable <R> ExecuteQuery <TElement, R>(TableQuery <TElement> query, EntityResolver <R> resolver,
                                                          TableRequestOptions requestOptions = null,
                                                          OperationContext operationContext  = null) where TElement : ITableEntity, new()
        {
            var parser           = new TableQueryParser();
            var filterExpression = parser.CreateFilterExpressionDynamic(query.FilterString).Compile();

            return
                (_entries.Where(filterExpression)
                 .Select(e => resolver(e.PartitionKey, e.RowKey, e.Timestamp, e.Properties, e.ETag))
                 .AsEnumerable());
        }
示例#3
0
        public IEnumerable <TElement> ExecuteQuery <TElement>(TableQuery <TElement> query, TableRequestOptions requestOptions = null,
                                                              OperationContext operationContext = null) where TElement : ITableEntity, new()
        {
            var parser           = new TableQueryParser();
            var filterExpression = parser.CreateFilterExpressionDynamic(query.FilterString).Compile();

            return(_entries.Where(filterExpression).Select(e =>
            {
                TElement newTElement = new TElement
                {
                    ETag = e.ETag,
                    PartitionKey = e.PartitionKey,
                    RowKey = e.RowKey,
                    Timestamp = e.Timestamp,
                };
                newTElement.ReadEntity(e.Properties, operationContext);
                return newTElement;
            }).AsEnumerable());
        }