Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fails with error "The given key was not present in the dictionary" when used on object retrieved via traversal. #116

Open
Rleahy opened this issue Dec 5, 2018 · 0 comments

Comments

@Rleahy
Copy link

Rleahy commented Dec 5, 2018

The key it prints out in that error message seems to be a serialisation of the entire object.

The object that causes the error is retrieved initially via this function which is part of the Target Object.

 public List<TargetStructure> GetStructures(){

  var result = GraphDB.DB.Traverse<TargetStructure, StructureOf>(new TraversalConfig
        {
            StartVertex = GetHandle(),
            GraphName = "StructureOf",
            Direction = EdgeDirection.Inbound
        });

    TargetStructure[] structs = result.Visited.Vertices.ToArray();
    List<TargetStructure> targets = new List<TargetStructure> ( );
    for(int i = 0; i < structs.Length; i++)
    {

        if( structs[i].LogicDataType=="TargetStructure" )
        {
            targets.Add(structs[i]);
        }
        
    }

   
  
    return targets;
    }

Trying to modify then update the object that gets returned causes the error.

If however i extract the key from the object this function returns and retrieve it fresh from the database then modify and update that instance of the object it works without issue.

Something about my traversal function seems to be returning an object that is broken in some way.

For reference the traversal function is supposed to get all TargetStructure documents connected to its self via StructureOf edges, which go from the TargetStructure to the Target Object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant