Skip to content

Commit

Permalink
More review.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcweber committed Jan 12, 2021
1 parent f2393fe commit 7605376
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/ExRam.Gremlinq.Core/AddStepHandling/AddStepHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public IAddStepHandler Override<TStep>(Func<IImmutableStack<Step>, TStep, IGreml
_dict.SetItem(
typeof(TStep),
TryGetAddHandler(typeof(TStep), typeof(TStep)) is Func<IImmutableStack<Step>, TStep, IGremlinQueryEnvironment, IAddStepHandler, IImmutableStack<Step>> existingAddHandler
? (steps, step, env, baseHandler, recurse) => addStepHandler(steps, step, env, existingAddHandler, recurse)
? (steps, step, env, _, recurse) => addStepHandler(steps, step, env, existingAddHandler, recurse)
: addStepHandler));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public GremlinQueryEnvironmentCacheImpl(IGremlinQueryEnvironment environment)
StringComparer.OrdinalIgnoreCase);

FastNativeTypes = environment.Model.NativeTypes
.ToDictionary(x => x, x => default(object?));
.ToDictionary(x => x, _ => default(object?));

_keyLookup = new KeyLookup(_environment.Model.PropertiesModel);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public IGremlinQueryExecutionResultDeserializer ConfigureFragmentDeserializer(Fu
: recurse.TryDeserialize(jToken, type.GetGenericArguments()[0], env)
: overridden(jToken, type, env, recurse);
})
.Override<JValue>((jToken, type, env, overridden, recurse) =>
.Override<JValue>((jToken, type, _, _, _) =>
{
return jToken.ToObject(type);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public IGremlinQueryFragmentDeserializer Override<TSerialized>(GremlinQueryFragm
_dict.SetItem(
typeof(TSerialized),
TryGetDeserializer(typeof(TSerialized), typeof(TSerialized)) is Func<TSerialized, Type, IGremlinQueryEnvironment, IGremlinQueryFragmentDeserializer, object?> existingFragmentDeserializer
? (fragment, type, env, baseSerializer, recurse) => deserializer(fragment, type, env, existingFragmentDeserializer, recurse)
? (fragment, type, env, _, recurse) => deserializer(fragment, type, env, existingFragmentDeserializer, recurse)
: deserializer));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static IGremlinQueryEnvironment StoreTimeSpansAsNumbers(this IGremlinQuer
return environment
.ConfigureSerializer(serializer => serializer
.ConfigureFragmentSerializer(fragmentSerializer => fragmentSerializer
.Override<TimeSpan>((t, env, overridden, recurse) => recurse.Serialize(t.TotalMilliseconds, env))))
.Override<TimeSpan>((t, env, _, recurse) => recurse.Serialize(t.TotalMilliseconds, env))))
.ConfigureDeserializer(deserializer => deserializer
.ConfigureFragmentDeserializer(fragmentDeserializer => fragmentDeserializer
.Override<JValue>((jValue, type, env, overridden, recurse) => type == typeof(TimeSpan)
Expand Down
6 changes: 3 additions & 3 deletions src/ExRam.Gremlinq.Core/Execution/GremlinQueryExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public IAsyncEnumerable<object> Execute(object serializedQuery, IGremlinQueryEnv
}
}

public static readonly IGremlinQueryExecutor Invalid = Create((query, env) => throw new InvalidOperationException($"'{nameof(IGremlinQueryExecutor.Execute)}' must not be called on {nameof(GremlinQueryExecutor)}.{nameof(Invalid)}. If you are getting this exception while executing a query, set a proper {nameof(GremlinQueryExecutor)} on the {nameof(GremlinQuerySource)} (e.g. with 'g.UseGremlinServer(...)' for GremlinServer which can be found in the 'ExRam.Gremlinq.Providers.GremlinServer' package)."));
public static readonly IGremlinQueryExecutor Invalid = Create((_, _) => throw new InvalidOperationException($"'{nameof(IGremlinQueryExecutor.Execute)}' must not be called on {nameof(GremlinQueryExecutor)}.{nameof(Invalid)}. If you are getting this exception while executing a query, set a proper {nameof(GremlinQueryExecutor)} on the {nameof(GremlinQuerySource)} (e.g. with 'g.UseGremlinServer(...)' for GremlinServer which can be found in the 'ExRam.Gremlinq.Providers.GremlinServer' package)."));

public static readonly IGremlinQueryExecutor Identity = Create((query, env) => new[] { query }.ToAsyncEnumerable());
public static readonly IGremlinQueryExecutor Identity = Create((query, _) => new[] { query }.ToAsyncEnumerable());

public static readonly IGremlinQueryExecutor Empty = Create((query, env) => AsyncEnumerable.Empty<object>());
public static readonly IGremlinQueryExecutor Empty = Create((_, _) => AsyncEnumerable.Empty<object>());

public static IGremlinQueryExecutor Create(Func<object, IGremlinQueryEnvironment, IAsyncEnumerable<object>> executor) => new GremlinQueryExecutorImpl(executor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ internal static IImmutableDictionary<MemberInfo, MemberMetadata> ConfigureNames(

public static IImmutableDictionary<MemberInfo, MemberMetadata> UseCamelCaseNames(this IImmutableDictionary<MemberInfo, MemberMetadata> names)
{
return names.ConfigureNames((member, key) => key.RawKey is string name
return names.ConfigureNames((_, key) => key.RawKey is string name
? name.ToCamelCase()
: key);
}

public static IImmutableDictionary<MemberInfo, MemberMetadata> UseLowerCaseNames(this IImmutableDictionary<MemberInfo, MemberMetadata> names)
{
return names.ConfigureNames((member, key) => key.RawKey is string name
return names.ConfigureNames((_, key) => key.RawKey is string name
? name.ToLower()
: key);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ExRam.Gremlinq.Core/Models/GraphElementModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ public static IGraphElementModel ConfigureLabels(this IGraphElementModel model,

public static IGraphElementModel UseCamelCaseLabels(this IGraphElementModel model)
{
return model.ConfigureLabels((type, proposedLabel) => proposedLabel.ToCamelCase());
return model.ConfigureLabels((_, proposedLabel) => proposedLabel.ToCamelCase());
}

public static IGraphElementModel UseLowerCaseLabels(this IGraphElementModel model)
{
return model.ConfigureLabels((type, proposedLabel) => proposedLabel.ToLower());
return model.ConfigureLabels((_, proposedLabel) => proposedLabel.ToLower());
}

internal static ImmutableArray<string> GetFilterLabelsOrDefault(this IGraphElementModel model, Type type, FilterLabelsVerbosity verbosity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public GremlinQuerySerializerImpl(IGremlinQueryFragmentSerializer fragmentSerial
_originalfragmentSerializer = fragmentSerializer;

_fragmentSerializer = fragmentSerializer
.Override<StepLabel>((stepLabel, env, @base, recurse) =>
.Override<StepLabel>((stepLabel, env, _, recurse) =>
{
if (!_stepLabelNames!.TryGetValue(stepLabel, out var stepLabelMapping))
{
Expand Down

0 comments on commit 7605376

Please sign in to comment.