public ZooKeeperResult Delete(string path, int version = -1, bool deleteChildrenIfNeeded = false) { LogDelete(path, version, deleteChildrenIfNeeded); return(ExecuteOperation( path, () => { var builder = Curator.delete(); builder = (DeleteBuilder)builder.withVersion(version); if (deleteChildrenIfNeeded) { builder = (DeleteBuilder)builder.deletingChildrenIfNeeded(); } builder.forPath(path); })); }