Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-17-2020 08:35 AM
Hi and thank you for neo4j,
we would like to use it in Version 4.x inside a Windows App.
So I decided to start with the tutorial from https://neo4j.com/developer/dotnet/#dotnet-driver
but getting an errormessage and cant find any informations how to fix that:
'IDriver' does not contain a definition for 'Session' and no accessible extension method 'Session'
for the following code:
using (var session = _driver.Session())
Are there any news for neo4j 4.0.0 that not working with the old (1.7) documentation?
Same on Stackoverflow: https://stackoverflow.com/questions/59581789/why-does-idriver-not-contain-a-definition-for-session-w...
Thank you and best regrads
Solved! Go to Solution.
02-05-2020 09:11 AM
Works with:
IDriver driver = GraphDatabase.Driver("neo4j://localhost:7687", AuthTokens.Basic("username", "pasSW0rd"));
IAsyncSession session = driver.AsyncSession(o => o.WithDatabase("neo4j"));
try
{
IResultCursor cursor = await session.RunAsync("CREATE (n) RETURN n");
await cursor.ConsumeAsync();
}
finally
{
await session.CloseAsync();
}
await driver.CloseAsync();
02-05-2020 09:11 AM
Works with:
IDriver driver = GraphDatabase.Driver("neo4j://localhost:7687", AuthTokens.Basic("username", "pasSW0rd"));
IAsyncSession session = driver.AsyncSession(o => o.WithDatabase("neo4j"));
try
{
IResultCursor cursor = await session.RunAsync("CREATE (n) RETURN n");
await cursor.ConsumeAsync();
}
finally
{
await session.CloseAsync();
}
await driver.CloseAsync();
All the sessions of the conference are now available online