// // Summary: // Visits the children of the System.Linq.Expressions.ListInitExpression. // // Parameters: // node: // The expression to visit. // // Returns: // The modified expression, if it or any subexpression was modified; otherwise, // returns the original expression. protected override Expression VisitListInit(ListInitExpression node) { Console.WriteLine("VisitListInit:"); Console.WriteLine('\t' + node.GetType().ToString()); Console.WriteLine('\t' + node.ToString()); return(base.VisitListInit(node)); }
public static void ToStringTest() { ListInitExpression e1 = Expression.ListInit(Expression.New(typeof(List <int>)), Expression.Parameter(typeof(int), "x")); Assert.Equal("new List`1() {Void Add(Int32)(x)}", e1.ToString()); ListInitExpression e2 = Expression.ListInit(Expression.New(typeof(List <int>)), Expression.Parameter(typeof(int), "x"), Expression.Parameter(typeof(int), "y")); Assert.Equal("new List`1() {Void Add(Int32)(x), Void Add(Int32)(y)}", e2.ToString()); }
internal override Expression VisitListInit(ListInitExpression init) { throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, init.ToString())); }
/// <summary>访问子内容为: <see cref="T:System.Linq.Expressions.ListInitExpression"></see>.</summary> /// <param name="node">被访问的表达式</param> /// <returns>The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.</returns> protected override Expression VisitListInit(ListInitExpression node) { Log(node.ToString()); throw new NotImplementedException(); }
internal override Expression VisitListInit(ListInitExpression init) { throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, SR.ALinqExpressionNotSupportedInProjectionToEntity, this.type, init.ToString())); }
protected virtual T VisitListInit(ListInitExpression exp) { throw new NotImplementedException(exp.ToString()); }
protected virtual Expression VisitListInit(ListInitExpression node) { Console.WriteLine("VisitListInit:" + node.ToString()); return(node); }
internal override Expression VisitListInit(ListInitExpression init) { throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Initializing instances of the entity type {0} with the expression {1} is not supported.", type, init.ToString())); }