当前位置: 首页>>代码示例>>C#>>正文


C# DbProjectExpression类代码示例

本文整理汇总了C#中DbProjectExpression的典型用法代码示例。如果您正苦于以下问题:C# DbProjectExpression类的具体用法?C# DbProjectExpression怎么用?C# DbProjectExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DbProjectExpression类属于命名空间,在下文中一共展示了DbProjectExpression类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Visit

        public override Expression Visit(DbProjectExpression expression)
        {
            Expression source = this.Visit(expression.Input.Expression);

            Type elementType = TypeHelper.GetElementType(source.Type);

            ParameterExpression param = Expression.Parameter(elementType, expression.Input.VariableName);
            using (this.CreateVariable(param, expression.Input.VariableName))
            {
                Expression projection = this.Visit(expression.Projection);
                LambdaExpression projectionLambda = Expression.Lambda(projection, param);

                return queryMethodExpressionBuilder.Select(source, projectionLambda);
            }
        }
开发者ID:DeadlyEmbrace,项目名称:effort,代码行数:15,代码来源:TransformVisitor.Project.cs

示例2: Project

 internal override DbExpression Project(DbProjectExpression project)
 {
     // source.Sort(o).Limit(k).Project(p).Project(p2) -> source.Sort(o).Limit(k).Project(e => p2(p(e)))
     return ComposeProject(
         DbExpressionBuilder.Limit(_sort, _limit.Limit),
         _project,
         project);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:8,代码来源:OrderByLifter.cs

示例3: Visit

        /// <summary>
        /// Implements the visitor pattern for <see cref="T:System.Data.Common.CommandTrees.DbProjectExpression"/>.
        /// </summary>
        /// <param name="expression">The <see cref="T:System.Data.Common.CommandTrees.DbProjectExpression"/> that is visited.</param>
        public override void Visit(DbProjectExpression expression)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            expression.Projection.Accept(this);
            expression.Input.Expression.Accept(this);
        }
开发者ID:raovat,项目名称:develop,代码行数:14,代码来源:DbCommandTreeScanner.cs

示例4: Visit

        public override SqlFragment Visit(DbProjectExpression expression)
        {
            SelectStatement select = VisitInputExpressionEnsureSelect(expression.Input.Expression, 
                expression.Input.VariableName, expression.Input.VariableType);

            // see if we need to wrap this select inside a new select
            select = WrapIfNotCompatible(select, expression.ExpressionKind);

            Debug.Assert(expression.Projection is DbNewInstanceExpression);
            VisitNewInstanceExpression(select, expression.Projection as DbNewInstanceExpression);

            return select;
        }
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:13,代码来源:SelectGenerator.cs

示例5: Visit

		public override void Visit(DbProjectExpression expression)
		{
			throw new NotSupportedException("Visit(\"ProjectExpression\") is not supported.");
		}
开发者ID:Outlivier,项目名称:FirebirdSql.Data.FirebirdClient,代码行数:4,代码来源:ExpressionTranslator.cs

示例6: Visit

            public override DbExpression Visit(DbProjectExpression expression)
            {
                // Only allowed cases:
                // SELECT Deref(x) FROM <expression> AS x
                // SELECT x FROM <expression> as x
                DbExpression testExpr = expression.Projection;
                if (DbExpressionKind.Deref == testExpr.ExpressionKind)
                {
                    testExpr = ((DbDerefExpression)testExpr).Argument;
                }

                if (DbExpressionKind.VariableReference == testExpr.ExpressionKind)
                {
                    DbVariableReferenceExpression varRef = (DbVariableReferenceExpression)testExpr;
                    if (varRef.VariableName.Equals(expression.Input.VariableName, StringComparison.Ordinal))
                    {
                        DbExpression found = Find(expression.Input.Expression);
                        if (!object.ReferenceEquals(found, expression.Input.Expression))
                        {
                            return found.BindAs(expression.Input.VariableName).Project(expression.Projection);
                        }
                    }
                }

                return expression;
            }
开发者ID:uQr,项目名称:referencesource,代码行数:26,代码来源:ObjectSpanRewriter.cs

示例7: ProjectSortLifter

 internal ProjectSortLifter(DbProjectExpression project, DbSortExpression sort, AliasGenerator aliasGenerator)
     : base(project, aliasGenerator)
 {
     _project = project;
     _sort = sort;
     _source = sort.Input.Expression;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:OrderByLifter.cs

示例8: Visit

 public override void Visit(DbProjectExpression expression) { }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:1,代码来源:DbExpressionVisitorTests.cs

示例9: ProjectLimitSortLifter

 internal ProjectLimitSortLifter(
     DbProjectExpression project, DbLimitExpression limit, DbSortExpression sort, AliasGenerator aliasGenerator)
     : base(project, aliasGenerator)
 {
     _project = project;
     _limit = limit;
     _sort = sort;
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:8,代码来源:OrderByLifter.cs

示例10: Visit

 public override DbExpression Visit(DbProjectExpression expression)
 {
     System.Diagnostics.Debug.Print("Visit(DbProjectExpression): {0}", expression);
     return base.Visit(expression);
 }
开发者ID:jcachat,项目名称:EntityFramework.DynamicFilters,代码行数:5,代码来源:DynamicFilterQueryVisitorCSpace.cs

示例11: ComposeProject

                protected static DbProjectExpression ComposeProject(
                    DbExpression input, DbProjectExpression first, DbProjectExpression second)
                {
                    // source.Project(first).Project(second) -> source.Project(e => second(first(e)))

                    // create lambda expression representing the second projection (e => second(e))
                    var secondLambda = DbExpressionBuilder.Lambda(second.Projection, second.Input.Variable);

                    // invoke lambda with variable from the first projection
                    var composed = first.Input.Project(secondLambda.Invoke(first.Projection));

                    return RebindProject(input, composed);
                }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:13,代码来源:OrderByLifter.cs

示例12: Visit

        /// <summary>
        ///     Visitor pattern method for <see cref="DbProjectExpression" />.
        /// </summary>
        /// <param name="expression"> The DbProjectExpression that is being visited. </param>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="expression" />
        ///     is null
        /// </exception>
        public override void Visit(DbProjectExpression expression)
        {
            Check.NotNull(expression, "expression");

            VisitExpressionBindingPre(expression.Input);
            VisitExpression(expression.Projection);
            VisitExpressionBindingPost(expression.Input);
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:16,代码来源:BasicExpressionVisitor.cs

示例13: Visit

        public override void Visit(DbProjectExpression e)
        {
            Check.NotNull(e, "e");

            Begin(e);
            Dump(e.Input, "Input");
            Dump(e.Projection, "Projection");
            End(e);
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:9,代码来源:ExpressionDumper.cs

示例14: ProjectSkipLifter

 internal ProjectSkipLifter(DbProjectExpression project, DbSkipExpression skip, AliasGenerator aliasGenerator)
     : base(project, aliasGenerator)
 {
     _project = project;
     _skip = skip;
     _source = _skip.Input.Expression;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:OrderByLifter.cs

示例15: Visit

 public override void Visit(DbProjectExpression e)
 {
     Begin(e);
     Dump(e.Input, "Input");
     Dump(e.Projection, "Projection");
     End(e);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:ExpressionDumper.cs


注:本文中的DbProjectExpression类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。