public void Update(Book book) { CommitMutation(new Mutation() { Update = new Entity[] { book.ToEntity() } }); }
public void Create(Book book) { book.Id = (long)CommitMutation(new Mutation() { InsertAutoId = new Entity[] { book.ToEntity() } }).MutationResult.InsertAutoIdKeys.First().Path.First().Id; }
// [END commitmutation] // [START create] public void Create(Book book) { var result = CommitMutation(new Mutation() { InsertAutoId = new Entity[] { book.ToEntity() } }); book.Id = result.MutationResult.InsertAutoIdKeys.First().Path.First().Id.Value; }
// [START create] public void Create(Book book) { var entity = book.ToEntity(); entity.Key = _db.CreateKeyFactory("Book").CreateIncompleteKey(); var keys = _db.Insert(new[] { entity }); book.Id = keys.First().Path.First().Id; }
public void Update(Book book) { _db.Update(book.ToEntity()); }