Beispiel #1
0
        public void TestIncompleteKey()
        {
            // [START incomplete_key]
            Key incompleteKey = _db.CreateKeyFactory("Task").CreateIncompleteKey();
            Key key           = _db.AllocateId(incompleteKey);

            // [END incomplete_key]
            Assert.True(IsValidKey(key));
        }
Beispiel #2
0
        public void AllocateId()
        {
            string projectId   = _fixture.ProjectId;
            string namespaceId = _fixture.NamespaceId;

            // Snippet: AllocateId
            DatastoreDb db         = DatastoreDb.Create(projectId, namespaceId);
            KeyFactory  keyFactory = db.CreateKeyFactory("message");
            Key         key        = db.AllocateId(keyFactory.CreateIncompleteKey());
            // End snippet
        }