Getting started with Cosmos and document db/sql. Why does this not work? No error is thrown, that I can see. There is data that should return.
private const string EndpointUri = "some url";
private const string PrimaryKey = "somekey";
private const string DbId = "People";
private const string CollectionId = "Person";
private DocumentClient client;
// GET: api/Person
[HttpGet]
public IEnumerable<Person> Get()
{
this.client = new DocumentClient(new Uri(EndpointUri), PrimaryKey);
FeedOptions queryOptions = new FeedOptions { MaxItemCount = 25, EnableCrossPartitionQuery = true };
IQueryable<Person> personQuery = this.client.CreateDocumentQuery<Person>(
UriFactory.CreateDocumentCollectionUri(DbId, CollectionId), queryOptions)
.Where(f => f.NameFirst != "Andersen");
List<Person> retVal = new List<Person>();
retVal = personQuery.ToList();
return retVal;
}