//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldCreateExplicitIndexTwice() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldCreateExplicitIndexTwice() { // Given Dictionary <string, string> config = new Dictionary <string, string>(); config["type"] = "exact"; config["provider"] = "lucene"; using (Transaction tx = beginTransaction()) { ExplicitIndexWrite indexWrite = tx.IndexWrite(); indexWrite.NodeExplicitIndexCreateLazily(INDEX_NAME, config); tx.Success(); } // When using (Transaction tx = beginTransaction()) { ExplicitIndexWrite indexWrite = tx.IndexWrite(); indexWrite.NodeExplicitIndexCreateLazily(INDEX_NAME, config); tx.Success(); } // Then using (Org.Neo4j.Graphdb.Transaction ctx = graphDb.beginTx()) { assertTrue(graphDb.index().existsForNodes(INDEX_NAME)); ctx.Success(); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private long addNodeToExplicitIndex() throws Exception private long AddNodeToExplicitIndex() { long nodeId; using (Transaction tx = beginTransaction()) { nodeId = tx.DataWrite().nodeCreate(); ExplicitIndexWrite indexWrite = tx.IndexWrite(); Dictionary <string, string> config = new Dictionary <string, string>(); config["type"] = "exact"; config["provider"] = "lucene"; indexWrite.NodeExplicitIndexCreateLazily(INDEX_NAME, config); indexWrite.NodeAddToExplicitIndex(INDEX_NAME, nodeId, KEY, VALUE); tx.Success(); } return(nodeId); }