コード例 #1
0
 private void CreateUniquenessConstraint()
 {
     using (Transaction tx = _db.beginTx())
     {
         _db.schema().constraintFor(TestLabels.LABEL_ONE).assertPropertyIsUnique(KEY).create();
         tx.Success();
     }
     using (Transaction tx = _db.beginTx())
     {
         _db.schema().awaitIndexesOnline(1, TimeUnit.MINUTES);
         tx.Success();
     }
 }
コード例 #2
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: private org.neo4j.test.OtherThreadExecutor.WorkerCommand<Void,Void> createAndAwaitIndex(final org.neo4j.graphdb.Label label, final String key)
        private WorkerCommand <Void, Void> CreateAndAwaitIndex(Label label, string key)
        {
            return(state =>
            {
                using (Transaction tx = _db.beginTx())
                {
                    _db.schema().indexFor(label).on(key).create();
                    tx.success();
                }
                using (Transaction ignore = _db.beginTx())
                {
                    _db.schema().awaitIndexesOnline(1, TimeUnit.MINUTES);
                }
                return null;
            });
        }