Skip to content

Instantly share code, notes, and snippets.

@erjjones
Created June 29, 2015 00:41
Show Gist options
  • Save erjjones/1591804f01c32e5f36f6 to your computer and use it in GitHub Desktop.
Save erjjones/1591804f01c32e5f36f6 to your computer and use it in GitHub Desktop.
Query Data In a Workspace
// Create a session for the workspace specified in the configuration.
using (var session = new WorkspaceSession(_configuration))
{
// We'll authenticate using standard workspace token authentication with an example user.
await session.AuthenticateAsync("{username}", "{password}");
// Insert example documents to ensure we have something to query.
await session.InsertDocumentAsync(new AnonymousCollection
{
DocumentID = Guid.NewGuid().ToString(),
Name = "Example Simple Entry 1"
});
var results = await session.Query<AnonymousCollection>()
.Where(ac => ac.Name.StartsWith("Example Simple Entry"))
.ToArrayAsync();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment