OfType<T>() is broken
See original GitHub issueDescribe the bug
I am trying to implment a wrapper around your client and am running into issues w/the OfType<T>() method. I’m trying to replicate the How_many_pets_does_everybody_have()
method from the test project. I am getting a different result than you are. I am pointing to the same Database and Graph and have the same object model in both projects.
The OfType<T>()
when T
is a base class (i.e., Pet
) is expected to reflect and determine any classes that inherit from it and should return a list of Type
s (i.e., Dog, Cat, Pet
).
Your test project produces:
V().hasLabel('Person').out('Owns').hasLabel('Cat','Dog','Pet')
which is correct and what I expect.
My implementation produces:
V().hasLabel('Person').out('Owns').hasLabel('Pet')
which is incorrect.
I have the same exact code, same class model, but different output. I tried cloning your repo and fixing whatever the issue is in the OfType<T>()
extension but the solution won’t build.
Here is my code and some screenshots showing what’s going on:
- My code is on left
- Your sample project is on the right
- You will see that I don’t get Cat or Dog
Pet
Mammal
Vertex
Dog
Cat
Issue Analytics
- State:
- Created a year ago
- Comments:27 (10 by maintainers)
Top GitHub Comments
For an ASP WebApi, you’re probably better off with the other sample app.
For the ExRam.Gremlinq project not building, I cannot reproduce. Everything builds fine in VS 2022 and on the build server.
In your sample code, the only configuration of a GraphModel is, for whatever reason, commented out and reads
Gremlinq has no ability to lookup all the Pet-derived classes when it only considers the assembly of Vertex and Edge, which are not in the same assembly as Pet or anything else, as far as I can see. There’s a method to include more assemblies.