Skip to content

Commit

Permalink
use nameof to get method names
Browse files Browse the repository at this point in the history
  • Loading branch information
ra0o0f committed Oct 15, 2016
1 parent adbdd32 commit 62953d9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 29 deletions.
1 change: 0 additions & 1 deletion src/ArangoDB.Client/ArangoDB.Client.Portable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
<Compile Include="Query\LinqUtility.cs" />
<Compile Include="Query\NamedExpression.cs" />
<Compile Include="Query\SupportedMethodSpecifications.cs" />
<Compile Include="Query\VisitorModificationData.cs" />
<Compile Include="Serialization\Converters\DateTimeConverter.cs" />
<Compile Include="Serialization\Converters\QueryParameterConverter.cs" />
<Compile Include="Serialization\Converters\EnumValueConverter.cs" />
Expand Down
4 changes: 2 additions & 2 deletions src/ArangoDB.Client/Query/ArangoExpressionTreeVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ protected override Expression VisitSubQuery(SubQueryExpression expression)
if (HandleLet)
visitor.DefaultAssociatedIdentifier = QueryModel.MainFromClause.ItemName;

visitor.QueryText = this.ModelVisitor.QueryText;
visitor.ParnetModelVisitor = this.ModelVisitor;
visitor.QueryText = ModelVisitor.QueryText;
visitor.ParnetModelVisitor = ModelVisitor;
visitor.IgnoreFromClause = HandleLet;

visitor.VisitQueryModel(expression.QueryModel);
Expand Down
7 changes: 2 additions & 5 deletions src/ArangoDB.Client/Query/ArangoModelVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ public class ArangoModelVisitor : QueryModelVisitorBase

public int GroupByNameCounter { get; set; }

//public VisitorCrudState CrudState { get; set; }
//public VisitorModificationData ModificationData { get; set; }

public bool DontReturn { get; set; }

public bool IgnoreFromClause { get; set; }
Expand Down Expand Up @@ -63,13 +60,13 @@ static ArangoModelVisitor()
{typeof(AverageResultOperator),"average"}
};
}

public override void VisitQueryModel(QueryModel queryModel)
{
if (DefaultAssociatedIdentifier != null)
queryModel.MainFromClause.ItemName = DefaultAssociatedIdentifier;

this.QueryModel = queryModel;
QueryModel = queryModel;

var resultOperator = queryModel.ResultOperators.Count != 0 ? queryModel.ResultOperators[0] : null;
var aggregateFunction = resultOperator != null && aggregateResultOperatorFunctions.ContainsKey(resultOperator.GetType())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public GraphDirectionExpressionNode(MethodCallExpressionParseInfo parseInfo,
{
switch(parseInfo.ParsedExpression.Method.Name)
{
case "InBound":
case nameof(QueryableExtensions.InBound):
Direction = Expression.Constant(Utils.EdgeDirectionToString(EdgeDirection.Inbound));
break;
case "OutBound":
case nameof(QueryableExtensions.OutBound):
Direction = Expression.Constant(Utils.EdgeDirectionToString(EdgeDirection.Outbound));
break;
case "AnyDirection":
case nameof(QueryableExtensions.AnyDirection):
Direction = Expression.Constant(Utils.EdgeDirectionToString(EdgeDirection.Any));
break;
}
Expand Down
2 changes: 0 additions & 2 deletions src/ArangoDB.Client/Query/Clause/GraphExpressionNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public GraphExpressionNode(MethodCallExpressionParseInfo parseInfo,
ConstantExpression edgeType)
: base(parseInfo)
{


GraphName = graphName;
if(vertexType != null && edgeType != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/ArangoDB.Client/Query/LinqUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static string ResolvePropertyName(string name)
return AddBacktickToName(ResolvePropertyNameRaw(name));
}

public static string AddBacktickToName(string name)
private static string AddBacktickToName(string name)
{
return string.Format("`{0}`", name);
}
Expand Down
15 changes: 0 additions & 15 deletions src/ArangoDB.Client/Query/VisitorModificationData.cs

This file was deleted.

0 comments on commit 62953d9

Please sign in to comment.