ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [01/11] ignite git commit: .NET: Remove more dead code from old LINQ CompiledQuery
Date Mon, 29 May 2017 07:11:57 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5075 3858bb58f -> 32b43db7f


.NET: Remove more dead code from old LINQ CompiledQuery


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cfc74364
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cfc74364
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cfc74364

Branch: refs/heads/ignite-5075
Commit: cfc74364c27ad06d38fc2bb40fdc442327e95285
Parents: bdd43ff
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Fri May 26 11:38:06 2017 +0300
Committer: Pavel Tupitsyn <ptupitsyn@apache.org>
Committed: Fri May 26 11:38:06 2017 +0300

----------------------------------------------------------------------
 .../Impl/CacheQueryExpressionVisitor.cs             | 12 +-----------
 .../Impl/CacheQueryModelVisitor.cs                  | 13 +------------
 .../dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs |  7 +++++--
 .../dotnet/Apache.Ignite.Linq/Impl/QueryData.cs     | 16 +---------------
 4 files changed, 8 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc74364/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryExpressionVisitor.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryExpressionVisitor.cs
b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryExpressionVisitor.cs
index 2d14ec4..8fa0b5d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryExpressionVisitor.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryExpressionVisitor.cs
@@ -313,22 +313,12 @@ namespace Apache.Ignite.Linq.Impl
                 ResultBuilder.AppendFormat("{0}.{1}", Aliases.GetTableAlias(expression),
fieldName);
             }
             else
-                AppendParameter(RegisterEvaluatedParameter(expression));
+                AppendParameter(ExpressionWalker.EvaluateExpression<object>(expression));
 
             return expression;
         }
 
         /// <summary>
-        /// Registers query parameter that is evaluated from a lambda expression argument.
-        /// </summary>
-        public object RegisterEvaluatedParameter(Expression expression)
-        {
-            _modelVisitor.ParameterExpressions.Add(expression);
-
-            return ExpressionWalker.EvaluateExpression<object>(expression);
-        }
-
-        /// <summary>
         /// Gets the name of the field from a member expression.
         /// </summary>
         private static string GetFieldName(MemberExpression expression, ICacheQueryableInternal
queryable)

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc74364/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryModelVisitor.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryModelVisitor.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryModelVisitor.cs
index f74ccc7..f566caa 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryModelVisitor.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryModelVisitor.cs
@@ -43,9 +43,6 @@ namespace Apache.Ignite.Linq.Impl
         private readonly List<object> _parameters = new List<object>();
 
         /** */
-        private readonly List<Expression> _parameterExpressions = new List<Expression>();
-
-        /** */
         private readonly AliasDictionary _aliases = new AliasDictionary();
 
         /// <summary>
@@ -63,7 +60,7 @@ namespace Apache.Ignite.Linq.Impl
 
             var qryText = _builder.ToString();
 
-            return new QueryData(qryText, _parameters, _parameterExpressions);
+            return new QueryData(qryText, _parameters);
         }
 
         /// <summary>
@@ -83,14 +80,6 @@ namespace Apache.Ignite.Linq.Impl
         }
 
         /// <summary>
-        /// Gets the parameters.
-        /// </summary>
-        public IList<Expression> ParameterExpressions
-        {
-            get { return _parameterExpressions; }
-        }
-
-        /// <summary>
         /// Gets the aliases.
         /// </summary>
         public AliasDictionary Aliases

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc74364/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs
index 578c5da..9446af3 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs
@@ -250,7 +250,8 @@ namespace Apache.Ignite.Linq.Impl
         /// <summary>
         /// Visits the SQL like expression.
         /// </summary>
-        private static void VisitSqlLike(MethodCallExpression expression, CacheQueryExpressionVisitor
visitor, string likeFormat)
+        private static void VisitSqlLike(MethodCallExpression expression, CacheQueryExpressionVisitor
visitor,
+            string likeFormat)
         {
             visitor.ResultBuilder.Append("(");
 
@@ -260,7 +261,9 @@ namespace Apache.Ignite.Linq.Impl
 
             var arg = expression.Arguments[0] as ConstantExpression;
 
-            var paramValue = arg != null ? arg.Value : visitor.RegisterEvaluatedParameter(expression.Arguments[0]);
+            var paramValue = arg != null
+                ? arg.Value
+                : ExpressionWalker.EvaluateExpression<object>(expression.Arguments[0]);
 
             visitor.Parameters.Add(paramValue);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc74364/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/QueryData.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/QueryData.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/QueryData.cs
index 5424692..81b91d2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/QueryData.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/QueryData.cs
@@ -33,24 +33,18 @@ namespace Apache.Ignite.Linq.Impl
         /** */
         private readonly string _queryText;
 
-        /** */
-        private readonly ICollection<Expression> _parameterExpressions;
-
         /// <summary>
         /// Initializes a new instance of the <see cref="QueryData"/> class.
         /// </summary>
         /// <param name="queryText">The query text.</param>
         /// <param name="parameters">The parameters.</param>
-        /// <param name="parameterExpressions"></param>
-        public QueryData(string queryText, ICollection<object> parameters, ICollection<Expression>
parameterExpressions)
+        public QueryData(string queryText, ICollection<object> parameters)
         {
             Debug.Assert(queryText != null);
             Debug.Assert(parameters != null);
-            Debug.Assert(parameterExpressions != null);
 
             _queryText = queryText;
             _parameters = parameters;
-            _parameterExpressions = parameterExpressions;
         }
 
         /// <summary>
@@ -70,14 +64,6 @@ namespace Apache.Ignite.Linq.Impl
         }
 
         /// <summary>
-        /// Gets the parameter expressions.
-        /// </summary>
-        public ICollection<Expression> ParameterExpressions
-        {
-            get { return _parameterExpressions; }
-        }
-
-        /// <summary>
         /// Returns a <see cref="string" /> that represents this instance.
         /// </summary>
         /// <returns>


Mime
View raw message