FlorianHockmann commented on code in PR #2205:
URL: https://github.com/apache/tinkerpop/pull/2205#discussion_r1304052705


##########
gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs:
##########
@@ -203,6 +203,15 @@ private GraphTraversal(ICollection<ITraversalStrategy> 
traversalStrategies, Byte
             Bytecode.AddStep("as", args.ToArray());
             return Wrap<TStart, TEnd>(this);
         }
+        
+        /// <summary>
+        ///     Adds the asString step to this <see 
cref="GraphTraversal{SType, EType}" />.
+        /// </summary>
+        public GraphTraversal<TStart, TEnd> AsString<TNewEnd> ()

Review Comment:
   `TNewEnd` isn't used so it can be completely removed.



##########
gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs:
##########
@@ -203,6 +203,15 @@ private GraphTraversal(ICollection<ITraversalStrategy> 
traversalStrategies, Byte
             Bytecode.AddStep("as", args.ToArray());
             return Wrap<TStart, TEnd>(this);
         }
+        
+        /// <summary>
+        ///     Adds the asString step to this <see 
cref="GraphTraversal{SType, EType}" />.
+        /// </summary>
+        public GraphTraversal<TStart, TEnd> AsString<TNewEnd> ()

Review Comment:
   Can't this return `GraphTraversal<TStart, string>`?
   
   The types should usually be the same as in Java.



##########
gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs:
##########
@@ -1932,6 +1950,24 @@ private GraphTraversal(ICollection<ITraversalStrategy> 
traversalStrategies, Byte
             Bytecode.AddStep("toE", args.ToArray());
             return Wrap<TStart, Edge>(this);
         }
+        
+        /// <summary>
+        ///     Adds the toLower step to this <see cref="GraphTraversal{SType, 
EType}" />.
+        /// </summary>
+        public GraphTraversal<TStart, TNewEnd> ToLower<TNewEnd> ()
+        {
+            Bytecode.AddStep("toLower");
+            return Wrap<TStart, TNewEnd>(this);
+        }
+        
+        /// <summary>
+        ///     Adds the toUpper step to this <see cref="GraphTraversal{SType, 
EType}" />.
+        /// </summary>
+        public GraphTraversal<TStart, TNewEnd> ToUpper<TNewEnd> ()

Review Comment:
   end here



##########
gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs:
##########
@@ -1932,6 +1950,24 @@ private GraphTraversal(ICollection<ITraversalStrategy> 
traversalStrategies, Byte
             Bytecode.AddStep("toE", args.ToArray());
             return Wrap<TStart, Edge>(this);
         }
+        
+        /// <summary>
+        ///     Adds the toLower step to this <see cref="GraphTraversal{SType, 
EType}" />.
+        /// </summary>
+        public GraphTraversal<TStart, TNewEnd> ToLower<TNewEnd> ()

Review Comment:
   Same here



##########
gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs:
##########
@@ -1115,6 +1124,15 @@ private GraphTraversal(ICollection<ITraversalStrategy> 
traversalStrategies, Byte
             Bytecode.AddStep("label");
             return Wrap<TStart, string>(this);
         }
+        
+        /// <summary>
+        ///     Adds the length step to this <see cref="GraphTraversal{SType, 
EType}" />.
+        /// </summary>
+        public GraphTraversal<TStart, TEnd> Length<TNewEnd> ()

Review Comment:
   In Java this returns `Number`, but isn't this usually an `int`? In that 
case, we could change this to:
   ```suggestion
           public GraphTraversal<TStart, int> Length()
   ```



##########
gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs:
##########
@@ -470,6 +470,10 @@ public static void InstantiateTranslationsForTestRun()
                {"g_addVXpersonX_propertyXname_joshX_propertyXage_nullX", new 
List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> 
{(g,p) =>g.AddV("person").Property("name","josh").Property("age",null), (g,p) 
=>g.V().Has("person","age",(object) null)}}, 
                
{"g_addVXpersonX_propertyXname_markoX_propertyXfriendWeight_null_acl_nullX", 
new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> 
{(g,p) 
=>g.AddV("person").Property("name","marko").Property("friendWeight",null,"acl",null),
 (g,p) =>g.V().Has("person","name","marko").Has("friendWeight",(object) null), 
(g,p) 
=>g.V().Has("person","name","marko").Properties<object>("friendWeight").Has("acl",(object)
 null), (g,p) 
=>g.V().Has("person","name","marko").Properties<object>("friendWeight").Count()}},
 
                
{"g_V_hasXperson_name_aliceX_propertyXsingle_age_unionXage_constantX1XX_sumX", 
new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> 
{(g,p) 
=>g.AddV("person").Property("name","alice").Property(Cardinality.Single,"age",50),
 (g,p) 
=>g.V().Has("person","name","alice").Property("age",__.Union<object>(__.Values<object>("age"),__.Constant<object>(1)).Sum<object>()),
 (g,p) =>g.V().Has("person","age",50), (g,p) =>g.V().Has("person","age",51)}}, 
+               {"g_injectX1_2X_asString", new List<Func<GraphTraversalSource, 
IDictionary<string, object>, ITraversal>> {(g,p) 
=>g.Inject(1,2).AsString<object>()}}, 

Review Comment:
   This shows what I meant in the other comment. It shouldn't be necessary to 
provide a type argument here to `AsString()` as that should always return a 
string.



##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/translator/DotNetTranslator.java:
##########
@@ -510,6 +510,7 @@ static final class SymbolHelper {
         private final static Map<String, String> FROM_CS_MAP = new HashMap<>();
 
         static {
+            TO_CS_MAP.put(GraphTraversal.Symbols.asString, "AsString<object>");

Review Comment:
   If we don't need these added steps to be generic in C#, then we also don't 
need to add them to this map here since the translator can just translate 
`asString` to `AsString`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to