public IEnumerable <T> Where(TableQuery <T> rangeQuery, Func <T, bool> filter = null) { var whereInMemory = new WhereInMemory(rangeQuery.FilterString); var data = whereInMemory.PartitionKey == null?this.ToArray() : this[whereInMemory.PartitionKey]; var result = data.Where(whereInMemory.PassRowKey); if (filter != null) { result = result.Where(filter); } return(result.ToArray()); }
public async Task<IEnumerable<T>> WhereAsync(TableQuery<T> rangeQuery, Func<T, bool> filter = null) { var whereInMemory = new WhereInMemory(rangeQuery.FilterString); var data = whereInMemory.PartitionKey == null ? await GetDataAsync() : await GetDataAsync(whereInMemory.PartitionKey); var result = data.Where(whereInMemory.PassRowKey); if (filter != null) result = result.Where(filter); return result.ToArray(); }