Exemplo n.º 1
0
 //
 // 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));
 }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
 internal override Expression VisitListInit(ListInitExpression init)
 {
     throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, init.ToString()));
 }
Exemplo n.º 4
0
 /// <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();
 }
Exemplo n.º 5
0
 internal override Expression VisitListInit(ListInitExpression init)
 {
     throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, SR.ALinqExpressionNotSupportedInProjectionToEntity, this.type, init.ToString()));
 }
Exemplo n.º 6
0
 protected virtual T VisitListInit(ListInitExpression exp)
 {
     throw new NotImplementedException(exp.ToString());
 }
Exemplo n.º 7
0
 protected virtual Expression VisitListInit(ListInitExpression node)
 {
     Console.WriteLine("VisitListInit:" + node.ToString());
     return(node);
 }
Exemplo n.º 8
0
 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()));
 }