• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Expressions.TypeBinaryExpression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TypeEqual

 internal static TypeEqual TypeEqual(TypeBinaryExpression expression)
 {
     return new TypeEqual()
     {
         Expression = Serialize(expression.Expression),
         TypeOperand = TypeRef.Serialize(expression.TypeOperand),
     }.Apply(n => n.Type = TypeRef.Serialize(expression.Type));
 }
开发者ID:takeshik,项目名称:yacq,代码行数:8,代码来源:TypeEqual.cs


示例2: SerializableTypeBinaryExpression

        /// <summary>
        /// Constructor with an <see cref="TypeBinaryExpression"/> and an <see cref="ExpressionConverter"/>.
        /// </summary>
        /// <param name="expression">The original, not serializable <see cref="Expression"/>.</param>
        /// <param name="expConverter">The <see cref="ExpressionConverter"/> to convert contained <see cref="Expression">Expressions</see>.</param>
        public SerializableTypeBinaryExpression(TypeBinaryExpression expression, ExpressionConverter expConverter)
            : base(expression, expConverter)
        {
            Expression = expression.Expression.MakeSerializable(expConverter);
#if !NETFX_CORE
            TypeOperand = InterLinqTypeSystem.Instance.GetInterLinqVersionOf<InterLinqType>(expression.TypeOperand);
#else
            TypeOperand = InterLinqTypeSystem.Instance.GetInterLinqVersionOf<InterLinqType>(expression.TypeOperand.GetTypeInfo());
#endif
        }
开发者ID:modulexcite,项目名称:Interlinq-2,代码行数:15,代码来源:SerializableTypeBinaryExpression.cs


示例3: ParseExpression

 static Node ParseExpression(TypeBinaryExpression e)
 {
     switch (e.NodeType)
     {
         case ExpressionType.TypeIs:
             return new BinaryNode
                 {
                     Left = Parse(e.Expression),
                     Operator = "is",
                     Right = new ConstantNode() { Text = NameOfType(e.TypeOperand) },
                     Value = GetValue(e)
                 };
         default:
             throw new NotImplementedException(string.Format(CultureInfo.CurrentCulture,
                                                             "Can't handle TypeBinaryExpression of type {0}",
                                                             e.NodeType));
     }
 }
开发者ID:joshrobb,项目名称:PowerAssert.Net,代码行数:18,代码来源:ExpressionParser.cs


示例4: VisitTypeIs

 protected virtual System.Linq.Expressions.Expression VisitTypeIs(TypeBinaryExpression b)
 {
     System.Linq.Expressions.Expression expr = Visit(b.Expression);
     if(expr != b.Expression)
     {
         return System.Linq.Expressions.Expression.TypeIs(expr, b.TypeOperand);
     }
     return b;
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:9,代码来源:ExpressionVisitor.cs


示例5: VisitTypeBinary

 /// <summary>
 /// Visits a TypeBinaryExpression.
 /// </summary>
 /// <param name="node">The TypeBinaryExpression.</param>
 /// <returns>The TypeBinaryExpression.</returns>
 protected override Expression VisitTypeBinary(TypeBinaryExpression node)
 {
     throw new NotImplementedException();
 }
开发者ID:mpobrien,项目名称:mongo-csharp-driver,代码行数:9,代码来源:ExpressionPrettyPrinter.cs


示例6: TypeBinaryExpressionMutator

 public TypeBinaryExpressionMutator(TypeBinaryExpression expression)
 {
     TypeBinaryExpression = expression;
 }
开发者ID:nlhepler,项目名称:mono,代码行数:4,代码来源:TypeBinaryExpressionMutator.cs


示例7: VisitTypeBinary

 private static string VisitTypeBinary(TypeBinaryExpression node)
 {
     throw new NotImplementedException();
 }
开发者ID:bryangrossman,项目名称:ZuoraMagic,代码行数:4,代码来源:ZOQLVisitor.cs


示例8: UpdateTypeIs

 protected TypeBinaryExpression UpdateTypeIs(TypeBinaryExpression binary, Expression expression, Type typeOperand)
 {
     if (expression != binary.Expression || typeOperand != binary.TypeOperand)
     {
         return Expression.TypeIs(expression, typeOperand);
     }
     return binary;
 }
开发者ID:Bitwix,项目名称:XeroAPI.Net,代码行数:8,代码来源:ExpressionVisitor.cs


示例9: VisitTypeIs

        /// <summary>
        /// Serializes an TypeBinaryExpression to a string
        /// </summary>
        /// <param name="b">TypeBinaryExpression to serialize</param>
        /// <returns>serialized expression</returns>
        internal override Expression VisitTypeIs(TypeBinaryExpression b)
        {
            this.builder.Append(UriHelper.ISOF);
            this.builder.Append(UriHelper.LEFTPAREN);

            if (!this.IsImplicitInputReference(b.Expression))
            {
                this.Visit(b.Expression);
                this.builder.Append(UriHelper.COMMA);
                this.builder.Append(UriHelper.SPACE);
            }

            this.builder.Append(UriHelper.QUOTE);
            this.builder.Append(UriHelper.GetTypeNameForUri(b.TypeOperand, this.context));
            this.builder.Append(UriHelper.QUOTE);
            this.builder.Append(UriHelper.RIGHTPAREN);

            return b;
        }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:24,代码来源:ExpressionWriter.cs


示例10: VisitTypeBinaryExpression

 protected override Expression VisitTypeBinaryExpression(TypeBinaryExpression expression)
 {
     return expression;
 }
开发者ID:aishaloshik,项目名称:EntityFramework,代码行数:4,代码来源:EntityResultFindingExpressionTreeVisitor.cs


示例11: BuildTypeIsQuery

        private IMongoQuery BuildTypeIsQuery(TypeBinaryExpression typeBinaryExpression)
        {
            var nominalType = typeBinaryExpression.Expression.Type;
            var actualType = typeBinaryExpression.TypeOperand;

            var discriminatorConvention = BsonSerializer.LookupDiscriminatorConvention(nominalType);
            var discriminator = discriminatorConvention.GetDiscriminator(nominalType, actualType);
            if (discriminator == null)
            {
                return new QueryDocument(); // matches everything
            }

            if (discriminator.IsBsonArray)
            {
                discriminator = discriminator.AsBsonArray[discriminator.AsBsonArray.Count - 1];
            }

            return Query.EQ(discriminatorConvention.ElementName, discriminator);
        }
开发者ID:nilayparikh,项目名称:mongo-csharp-driver,代码行数:19,代码来源:SelectQuery.cs


示例12: VisitTypeIs

 internal override Expression VisitTypeIs(TypeBinaryExpression b)
 {
     if (ClientType.CheckElementTypeIsEntity(b.Expression.Type) || IsCollectionProducingExpression(b.Expression))
     {
         throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, b.ToString()));
     }
     
     return base.VisitTypeIs(b);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:9,代码来源:ProjectionAnalyzer.cs


示例13: VisitTypeBinary

 /// <summary>
 /// Visits a TypeBinaryExpression.
 /// </summary>
 /// <param name="node">The TypeBinaryExpression.</param>
 /// <returns>The TypeBinaryExpression.</returns>
 protected override Expression VisitTypeBinary(TypeBinaryExpression node)
 {
     _sb.Append("<TypeBinaryExpression>");
     return node;
 }
开发者ID:doobiwan,项目名称:mongo-csharp-driver,代码行数:10,代码来源:ExpressionFormatter.cs


示例14: VisitTypeBinary

        protected override Expression VisitTypeBinary(TypeBinaryExpression b)
        {
            var f = GetField(b.Expression);

            FieldReference fr = f as FieldReference;
            if (fr != null)
            {
                if (b.TypeOperand.IsAssignableFrom(fr.FieldType))
                {
                    sb.Append(fr.Name.SqlEscape() + " IS NOT NULL");
                }
                else
                    throw new InvalidOperationException("A {0} will never be {1}".FormatWith(fr.FieldType.TypeName(), b.TypeOperand.TypeName()));

                return b;
            }

            FieldImplementedBy fib = f as FieldImplementedBy;
            if (fib != null)
            {
                var imp = fib.ImplementationColumns.Where(kvp => b.TypeOperand.IsAssignableFrom(kvp.Key));

                if (imp.Any())
                    sb.Append(imp.ToString(kvp => kvp.Value.Name.SqlEscape() + " IS NOT NULL", " OR "));
                else
                    throw new InvalidOperationException("No implementation ({0}) will never be {1}".FormatWith(fib.ImplementationColumns.Keys.ToString(t=>t.TypeName(), ", "), b.TypeOperand.TypeName()));

                return b;
            }

            throw new NotSupportedException("'is' only works with ImplementedBy or Reference fields");
        }
开发者ID:rondoo,项目名称:framework,代码行数:32,代码来源:UniqueIndex.cs


示例15: CompareTypeIs

 protected virtual bool CompareTypeIs(TypeBinaryExpression a, TypeBinaryExpression b)
 {
     return a.TypeOperand == b.TypeOperand
         && this.Compare(a.Expression, b.Expression);
 }
开发者ID:hamdouchi97,项目名称:Stump.ORM,代码行数:5,代码来源:ExpressionComparer.cs


示例16: VisitTypeIs

		protected virtual Expression VisitTypeIs (TypeBinaryExpression type)
		{
			Expression e = Visit (type.Expression);
			if (e != type.Expression)
				return Expression.TypeIs (e, type.TypeOperand);

			return type;
		}
开发者ID:kstreet,项目名称:Street.MvxPlugins,代码行数:8,代码来源:ExpressionVisitor.cs


示例17: VisitTypeBinaryExpression

 protected override Expression VisitTypeBinaryExpression(TypeBinaryExpression expression) => expression;
开发者ID:aishaloshik,项目名称:EntityFramework,代码行数:1,代码来源:QuerySourceTracingExpressionTreeVisitor.cs


示例18: VisitTypeIs

 protected virtual Expression VisitTypeIs(TypeBinaryExpression binary)
 {
     Expression expr = this.Visit(binary.Expression);
     return this.UpdateTypeIs(binary, expr, binary.TypeOperand);
 }
开发者ID:Bitwix,项目名称:XeroAPI.Net,代码行数:5,代码来源:ExpressionVisitor.cs


示例19: VisitTypeIs

 protected virtual Expression VisitTypeIs(TypeBinaryExpression b)
 {
     Expression expr = Visit(b.Expression);
     return UpdateTypeIs(b, expr, b.TypeOperand);
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:5,代码来源:ExpressionVistor.cs


示例20: VisitTypeIs

 protected override Expression VisitTypeIs(TypeBinaryExpression b)
 {
     this.Visit(b.Expression);
     this.Write(" is ");
     this.Write(this.GetTypeName(b.TypeOperand));
     return b;
 }
开发者ID:PaybackMan,项目名称:Cinder,代码行数:7,代码来源:ExpressionWriter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Expressions.UnaryExpression类代码示例发布时间:2022-05-26
下一篇:
C# Expressions.ParameterExpression类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap