FlorianHockmann commented on a change in pull request #1567:
URL: https://github.com/apache/tinkerpop/pull/1567#discussion_r807679638
##########
File path:
gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
##########
@@ -148,7 +148,9 @@ private IGraphSONSerializer TryGetSerializerFor(Type type)
private bool IsDictionaryType(Type type)
{
- return type.IsConstructedGenericType &&
type.GetGenericTypeDefinition() == typeof(Dictionary<,>);
+ return type
+ .GetInterfaces()
+ .Any(@interface => @interface.IsConstructedGenericType &&
@interface.GetGenericTypeDefinition() == typeof(IEnumerable<>) &&
@interface.GenericTypeArguments[0] is { IsConstructedGenericType: true }
genericArgument && genericArgument.GetGenericTypeDefinition() ==
typeof(KeyValuePair<,>));
Review comment:
(nitpick) Please split the long line.
Also how about renaming `@interface` to `interfaceType`? I think starting a
variable name with `@` is a bit uncommon and it makes me wonder as a reader
whether there's anything special to it to give it this name.
--
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]