Created
June 29, 2015 00:41
-
-
Save erjjones/1591804f01c32e5f36f6 to your computer and use it in GitHub Desktop.
Query Data In a Workspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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