Skip to content

Instantly share code, notes, and snippets.

@erjjones
Created June 29, 2015 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erjjones/d253cf83d9e9a74966c0 to your computer and use it in GitHub Desktop.
Save erjjones/d253cf83d9e9a74966c0 to your computer and use it in GitHub Desktop.
Store Data In a Workspace Then Delete
// 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}");
var anonymousDocument = new AnonymousCollection
{
DocumentID = Guid.NewGuid().ToString(),
Name = "Example Inserted Document"
};
var result = await session.InsertDocumentAsync(anonymousDocument);
// Lets clean-up the document we created.
await session.DeleteDocumentAsync<AnonymousCollection>(anonymousDocument.DocumentID);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment