MoviesDotNetCore solution does not return new movie I added to movies database

I have taken your additional movie and added it into my local db, and run the demo solution locally - and things are working ok.

Now.

I have changed the code in 2 places, basically as I'm very anti-environment variables:

In startup.cs

I replaced the AddSingleton call with this: (around line 27)

services.AddSingleton(GraphDatabase.Driver(
    "neo4j://localhost:7687", AuthTokens.Basic("neo4j", "neo4jneo4j"))); 
    //obvs, use your user/pass here

Then I changed the MoviesRepository.cs changing the the WithDatabase method (around line 144) to this:

private static void WithDatabase(SessionConfigBuilder sessionConfigBuilder)
{
   sessionConfigBuilder.WithDatabase("neo4j"); //You should use your DB name here
}

Both of these areas used Environment Vars to get information (neo4j version, user/pass etc) that I think introduced complexity you don't need.

Can you try this and see how you go?

Charlotte

1 Like