/// <inheritdoc />
        void IPrintableExpression.Print(ExpressionPrinter expressionPrinter)
        {
            Check.NotNull(expressionPrinter, nameof(expressionPrinter));

            expressionPrinter.Append(nameof(ProjectionBindingExpression) + ": ");
            if (ProjectionMember != null)
            {
                expressionPrinter.Append(ProjectionMember.ToString());
            }
            else if (Index != null)
            {
                expressionPrinter.Append(Index.ToString() !);
            }
#pragma warning disable CS0618 // Type or member is obsolete
            else if (IndexMap != null)
            {
                using (expressionPrinter.Indent())
                {
                    foreach (var kvp in IndexMap)
                    {
                        expressionPrinter.AppendLine($"{kvp.Key.Name}:{kvp.Value},");
                    }
                }
            }
#pragma warning restore CS0618 // Type or member is obsolete
        }
예제 #2
0
 /// <summary>
 ///     Creates a new instance of the <see cref="ProjectionBindingExpression" /> class.
 /// </summary>
 /// <param name="queryExpression">The query expression to get the value from.</param>
 /// <param name="projectionMember">The projection member to bind with query expression.</param>
 /// <param name="type">The clr type of value being read.</param>
 public ProjectionBindingExpression(
     Expression queryExpression,
     ProjectionMember projectionMember,
     Type type)
 {
     QueryExpression  = queryExpression;
     ProjectionMember = projectionMember;
     Type             = type;
 }
예제 #3
0
 /// <inheritdoc />
 void IPrintableExpression.Print(ExpressionPrinter expressionPrinter)
 {
     expressionPrinter.Append(nameof(ProjectionBindingExpression) + ": ");
     if (ProjectionMember != null)
     {
         expressionPrinter.Append(ProjectionMember.ToString());
     }
     else if (Index != null)
     {
         expressionPrinter.Append(Index.ToString() !);
     }
 }
        /// <summary>
        ///     Creates a new instance of the <see cref="ProjectionBindingExpression" /> class.
        /// </summary>
        /// <param name="queryExpression"> The query expression to get the value from. </param>
        /// <param name="projectionMember"> The projection member to bind with query expression. </param>
        /// <param name="type"> The clr type of value being read. </param>
        public ProjectionBindingExpression(
            [NotNull] Expression queryExpression,
            [NotNull] ProjectionMember projectionMember,
            [NotNull] Type type)
        {
            Check.NotNull(queryExpression, nameof(queryExpression));
            Check.NotNull(projectionMember, nameof(projectionMember));
            Check.NotNull(type, nameof(type));

            QueryExpression  = queryExpression;
            ProjectionMember = projectionMember;
            Type             = type;
        }
        /// <inheritdoc />
        public virtual void Print(ExpressionPrinter expressionPrinter)
        {
            Check.NotNull(expressionPrinter, nameof(expressionPrinter));

            expressionPrinter.Append(nameof(ProjectionBindingExpression) + ": ");
            if (ProjectionMember != null)
            {
                expressionPrinter.Append(ProjectionMember.ToString());
            }
            else if (Index != null)
            {
                expressionPrinter.Append(Index.ToString());
            }
            else
            {
                using (expressionPrinter.Indent())
                {
                    foreach (var kvp in IndexMap)
                    {
                        expressionPrinter.AppendLine($"{kvp.Key.Name}:{kvp.Value},");
                    }
                }
            }
        }