Skip to content

Issue with transaction configuration #855

@stefano-ottolenghi

Description

@stefano-ottolenghi

This works.

await session.RunAsync(
    "CREATE (a:Person {name: $name})",
    new { name = "John" }
);

This also works.

await session.RunAsync(
    "CREATE (a:Person {name: 'John'})",
    conf => conf
        .WithTimeout(new TimeSpan(5))
        .WithMetadata(new Dictionary<string, object>{ { "appName", "peopleTracker" } })
);

This does not.

await session.RunAsync(
    "CREATE (a:Person {name: $name})",
    new { name = "John" },
    conf => conf
        .WithTimeout(new TimeSpan(5))
        .WithMetadata(new Dictionary<string, object>{ { "appName", "peopleTracker" } })
);

and errors with

error CS1503: Argument 2: cannot convert from '<anonymous type: string name>' to 'System.Collections.Generic.IDictionary<string, object>' [/home/stefano/git/docs-testing/drivers/runners/dotnet/example-project/dotnet-neo4j.csproj]

The types don't change across the different signatures, so really a combination of the first two snippets should work wonders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions