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


C# CsdlSemanticsSchema.WrapLabeledElement方法代码示例

本文整理汇总了C#中CsdlSemanticsSchema.WrapLabeledElement方法的典型用法代码示例。如果您正苦于以下问题:C# CsdlSemanticsSchema.WrapLabeledElement方法的具体用法?C# CsdlSemanticsSchema.WrapLabeledElement怎么用?C# CsdlSemanticsSchema.WrapLabeledElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CsdlSemanticsSchema的用法示例。


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

示例1: WrapExpression

        internal static IEdmExpression WrapExpression(CsdlExpressionBase expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema)
        {
            if (expression != null)
            {
                switch (expression.ExpressionKind)
                {
                    case EdmExpressionKind.Cast:
                        return new CsdlSemanticsCastExpression((CsdlCastExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.BinaryConstant:
                        return new CsdlSemanticsBinaryConstantExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.BooleanConstant:
                        return new CsdlSemanticsBooleanConstantExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.Collection:
                        return new CsdlSemanticsCollectionExpression((CsdlCollectionExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.DateTimeOffsetConstant:
                        return new CsdlSemanticsDateTimeOffsetConstantExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.DecimalConstant:
                        return new CsdlSemanticsDecimalConstantExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.EntitySetReference:
                        return new CsdlSemanticsEntitySetReferenceExpression((CsdlEntitySetReferenceExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.EnumMember:
                    case EdmExpressionKind.EnumMemberReference:
                        return new CsdlSemanticsEnumMemberExpression((CsdlEnumMemberExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.FloatingConstant:
                        return new CsdlSemanticsFloatingConstantExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.Null:
                        return new CsdlSemanticsNullExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.OperationApplication:
                        return new CsdlSemanticsApplyExpression((CsdlApplyExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.OperationReference:
                        return new CsdlSemanticsOperationReferenceExpression((CsdlOperationReferenceExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.GuidConstant:
                        return new CsdlSemanticsGuidConstantExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.If:
                        return new CsdlSemanticsIfExpression((CsdlIfExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.IntegerConstant:
                        return new CsdlSemanticsIntConstantExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.IsType:
                        return new CsdlSemanticsIsTypeExpression((CsdlIsTypeExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.LabeledExpressionReference:
                        return new CsdlSemanticsLabeledExpressionReferenceExpression((CsdlLabeledExpressionReferenceExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.Labeled:
                        return schema.WrapLabeledElement((CsdlLabeledExpression)expression, bindingContext);
                    case EdmExpressionKind.ParameterReference:
                        return new CsdlSemanticsParameterReferenceExpression((CsdlParameterReferenceExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.Path:
                        return new CsdlSemanticsPathExpression((CsdlPathExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.PropertyPath:
                        return new CsdlSemanticsPropertyPathExpression((CsdlPropertyPathExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.NavigationPropertyPath:
                        return new CsdlSemanticsNavigationPropertyPathExpression((CsdlNavigationPropertyPathExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.PropertyReference:
                        return new CsdlSemanticsPropertyReferenceExpression((CsdlPropertyReferenceExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.Record:
                        return new CsdlSemanticsRecordExpression((CsdlRecordExpression)expression, bindingContext, schema);
                    case EdmExpressionKind.StringConstant:
                        return new CsdlSemanticsStringConstantExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.DurationConstant:
                        return new CsdlSemanticsDurationConstantExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.DateConstant:
                        return new CsdlSemanticsDateConstantExpression((CsdlConstantExpression)expression, schema);
                    case EdmExpressionKind.TimeOfDayConstant:
                        return new CsdlSemanticsTimeOfDayConstantExpression((CsdlConstantExpression)expression, schema);
                }
            }

            return null;
        }
开发者ID:rossjempson,项目名称:odata.net,代码行数:68,代码来源:CsdlSemanticsModel.cs


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