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

C# CsdlSemanticsSchema类代码示例

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

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



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

示例1: CsdlSemanticsEntitySetTests

        public CsdlSemanticsEntitySetTests()
        {
            var referentialConstraints = new List<CsdlReferentialConstraint>();
            var csdlNavigation = new CsdlNavigationProperty("Navigation", null, null, null, false, null, referentialConstraints, null, null);
            this.csdlEntityType = new CsdlEntityType("EntityType", null, false, false, false, null, Enumerable.Empty<CsdlProperty>(), new[] { csdlNavigation }, null, null);
            var goodBinding = new CsdlNavigationPropertyBinding("Navigation", "EntitySet", null, new CsdlLocation(1, 1));
            this.csdlEntitySet = new CsdlEntitySet("EntitySet", "FQ.NS.EntityType", new[] { goodBinding }, null, null);
            this.csdlContainer = new CsdlEntityContainer("Container", null, new[] { this.csdlEntitySet }, Enumerable.Empty<CsdlSingleton>(), Enumerable.Empty<CsdlOperationImport>(), null, null);

            var derivedCsdlNavigation = new CsdlNavigationProperty("DerivedNavigation", null, null, null, false, null, referentialConstraints, null, null);
            var derivedCsdlEntityType = new CsdlEntityType("DerivedEntityType", "FQ.NS.EntityType", false, false, false, null, Enumerable.Empty<CsdlProperty>(), new[] { derivedCsdlNavigation }, null, null);

            var unrelatedCsdlEntityType = new CsdlEntityType("UnrelatedEntityType", null, false, false, false, null, Enumerable.Empty<CsdlProperty>(), Enumerable.Empty<CsdlNavigationProperty>(), null, null);

            var csdlSchema = new CsdlSchema("FQ.NS", null, null, new[] { this.csdlEntityType, derivedCsdlEntityType, unrelatedCsdlEntityType }, Enumerable.Empty<CsdlEnumType>(), Enumerable.Empty<CsdlOperation>(),Enumerable.Empty<CsdlTerm>(),Enumerable.Empty<CsdlEntityContainer>(),Enumerable.Empty<CsdlAnnotations>(), Enumerable.Empty<CsdlTypeDefinition>(), null, null);
            var csdlModel = new CsdlModel();
            csdlModel.AddSchema(csdlSchema);
            var semanticModel = new CsdlSemanticsModel(csdlModel, new EdmDirectValueAnnotationsManager(), Enumerable.Empty<IEdmModel>());
            this.semanticSchema = new CsdlSemanticsSchema(semanticModel, csdlSchema);
            this.semanticContainer = new CsdlSemanticsEntityContainer(this.semanticSchema, this.csdlContainer);

            this.semanticEntityType = semanticModel.FindType("FQ.NS.EntityType") as CsdlSemanticsEntityTypeDefinition;
            this.semanticEntityType.Should().NotBeNull();
            this.navigationProperty = this.semanticEntityType.FindProperty("Navigation") as CsdlSemanticsNavigationProperty;
            this.navigationProperty.Should().NotBeNull();
        }
开发者ID:rossjempson,项目名称:odata.net,代码行数:26,代码来源:CsdlSemanticsEntitySetTests.cs


示例2: CsdlSemanticsPrimitiveTypeReference

 public CsdlSemanticsPrimitiveTypeReference(CsdlSemanticsSchema schema, CsdlPrimitiveTypeReference reference)
     : base(reference)
 {
     this.schema = schema;
     this.Reference = reference;
     this.definition = EdmCoreModel.Instance.GetPrimitiveType(this.Reference.Kind); 
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:7,代码来源:CsdlSemanticsPrimitiveTypeReference.cs


示例3: CsdlSemanticsRecordExpression

		public CsdlSemanticsRecordExpression(CsdlRecordExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema) : base(schema, expression)
		{
			this.declaredTypeCache = new Cache<CsdlSemanticsRecordExpression, IEdmStructuredTypeReference>();
			this.propertiesCache = new Cache<CsdlSemanticsRecordExpression, IEnumerable<IEdmPropertyConstructor>>();
			this.expression = expression;
			this.bindingContext = bindingContext;
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:CsdlSemanticsRecordExpression.cs


示例4: CsdlSemanticsApplyExpression

 public CsdlSemanticsApplyExpression(CsdlApplyExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema)
     : base(schema, expression)
 {
     this.expression = expression;
     this.bindingContext = bindingContext;
     this.schema = schema;
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:7,代码来源:CsdlSemanticsApplyExpression.cs


示例5: CsdlSemanticsPropertyReferenceExpression

		public CsdlSemanticsPropertyReferenceExpression(CsdlPropertyReferenceExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema) : base(schema, expression)
		{
			this.baseCache = new Cache<CsdlSemanticsPropertyReferenceExpression, IEdmExpression>();
			this.elementCache = new Cache<CsdlSemanticsPropertyReferenceExpression, IEdmProperty>();
			this.expression = expression;
			this.bindingContext = bindingContext;
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:CsdlSemanticsPropertyReferenceExpression.cs


示例6: EnsureFunctionImportFunctionPropertyIsUnresolvedFunction

        public void EnsureFunctionImportFunctionPropertyIsUnresolvedFunction()
        {
            var functionImport = new CsdlFunctionImport("GetStuff", "FQ.NS.GetStuff", null /*entitySet*/, true /*includeInServiceDocument*/, null /*documentation*/, testLocation);
            var csdlEntityContainer = CsdlBuilder.EntityContainer("Container", operationImports: new CsdlOperationImport[] {functionImport});
            var schema = CsdlBuilder.Schema("FQ.NS", csdlEntityContainers: new CsdlEntityContainer[] { csdlEntityContainer });
            var csdlModel = new CsdlModel();
            csdlModel.AddSchema(schema);
            
            var semanticSchema = new CsdlSemanticsSchema(new CsdlSemanticsModel(csdlModel, new EdmDirectValueAnnotationsManager(), Enumerable.Empty<IEdmModel>()), schema);

            CsdlSemanticsEntityContainer container = new CsdlSemanticsEntityContainer(semanticSchema, csdlEntityContainer);
            var imports = container.OperationImports().ToList();
            imports.Should().HaveCount(1);
            var csdlFunctionImport = (IEdmFunctionImport)imports[0];
            csdlFunctionImport.Name.Should().Be("GetStuff");
            csdlFunctionImport.Operation.GetType().Should().Be(typeof(UnresolvedFunction));
            var errors = csdlFunctionImport.Operation.As<BadElement>().Errors.ToList();
            errors.Should().HaveCount(1);
            errors.First().ErrorMessage.Should().Be(Strings.Bad_UnresolvedOperation("FQ.NS.GetStuff"));
            csdlFunctionImport.Container.Name.Should().Be("Container");
            csdlFunctionImport.Location().Should().Be(testLocation);
            csdlFunctionImport.ContainerElementKind.Should().Be(EdmContainerElementKind.FunctionImport);
            csdlFunctionImport.EntitySet.Should().BeNull();
            csdlFunctionImport.IncludeInServiceDocument.Should().BeTrue();
            csdlFunctionImport.Function.IsComposable.Should().BeFalse();
        }
开发者ID:rossjempson,项目名称:odata.net,代码行数:26,代码来源:CsdlSemanticsEntityContainerTests.cs


示例7: CsdlSemanticsAssertTypeExpression

		public CsdlSemanticsAssertTypeExpression(CsdlAssertTypeExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema) : base(schema, expression)
		{
			this.operandCache = new Cache<CsdlSemanticsAssertTypeExpression, IEdmExpression>();
			this.typeCache = new Cache<CsdlSemanticsAssertTypeExpression, IEdmTypeReference>();
			this.expression = expression;
			this.bindingContext = bindingContext;
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:CsdlSemanticsAssertTypeExpression.cs


示例8: CsdlSemanticsCollectionExpression

		public CsdlSemanticsCollectionExpression(CsdlCollectionExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema) : base(schema, expression)
		{
			this.declaredTypeCache = new Cache<CsdlSemanticsCollectionExpression, IEdmTypeReference>();
			this.elementsCache = new Cache<CsdlSemanticsCollectionExpression, IEnumerable<IEdmExpression>>();
			this.expression = expression;
			this.bindingContext = bindingContext;
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:CsdlSemanticsCollectionExpression.cs


示例9: CsdlSemanticsApplyExpression

		public CsdlSemanticsApplyExpression(CsdlApplyExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema) : base(schema, expression)
		{
			this.appliedFunctionCache = new Cache<CsdlSemanticsApplyExpression, IEdmExpression>();
			this.argumentsCache = new Cache<CsdlSemanticsApplyExpression, IEnumerable<IEdmExpression>>();
			this.expression = expression;
			this.bindingContext = bindingContext;
			this.schema = schema;
		}
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:CsdlSemanticsApplyExpression.cs


示例10: CsdlSemanticsLabeledExpression

		public CsdlSemanticsLabeledExpression(string name, CsdlExpressionBase element, IEdmEntityType bindingContext, CsdlSemanticsSchema schema) : base(element)
		{
			this.expressionCache = new Cache<CsdlSemanticsLabeledExpression, IEdmExpression>();
			this.name = name;
			this.sourceElement = element;
			this.bindingContext = bindingContext;
			this.schema = schema;
		}
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:CsdlSemanticsLabeledExpression.cs


示例11: CsdlSemanticsIfExpression

		public CsdlSemanticsIfExpression(CsdlIfExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema) : base(schema, expression)
		{
			this.testCache = new Cache<CsdlSemanticsIfExpression, IEdmExpression>();
			this.ifTrueCache = new Cache<CsdlSemanticsIfExpression, IEdmExpression>();
			this.ifFalseCache = new Cache<CsdlSemanticsIfExpression, IEdmExpression>();
			this.expression = expression;
			this.bindingContext = bindingContext;
		}
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:CsdlSemanticsIfExpression.cs


示例12: CsdlSemanticsVocabularyAnnotation

 protected CsdlSemanticsVocabularyAnnotation(CsdlSemanticsSchema schema, IEdmVocabularyAnnotatable targetContext, CsdlSemanticsAnnotations annotationsContext, CsdlAnnotation annotation, string qualifier)
     : base(annotation)
 {
     this.schema = schema;
     this.Annotation = annotation;
     this.qualifier = qualifier ?? annotation.Qualifier;
     this.targetContext = targetContext;
     this.annotationsContext = annotationsContext;
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:9,代码来源:CsdlSemanticsVocabularyAnnotation.cs


示例13: CsdlSemanticsOperationTests

        public CsdlSemanticsOperationTests()
        {
            this.csdlEntityType = new CsdlEntityType("EntityType", null, false, false, false, null, Enumerable.Empty<CsdlProperty>(), Enumerable.Empty<CsdlNavigationProperty>(), null, null);

            var csdlSchema = CsdlBuilder.Schema("FQ.NS", csdlStructuredTypes: new[] { this.csdlEntityType });
            
            var csdlModel = new CsdlModel();
            csdlModel.AddSchema(csdlSchema);
            var semanticModel = new CsdlSemanticsModel(csdlModel, new EdmDirectValueAnnotationsManager(), Enumerable.Empty<IEdmModel>());
            this.semanticSchema = new CsdlSemanticsSchema(semanticModel, csdlSchema);
            this.testLocation = new CsdlLocation(1, 3);
        }
开发者ID:larsenjo,项目名称:odata.net,代码行数:12,代码来源:CsdlSemanticsOperationTests.cs


示例14: EnsureActionImportActionPropertyIsUnresolvedAction

 public void EnsureActionImportActionPropertyIsUnresolvedAction()
 {
     var actionImport = new CsdlActionImport("Action", "FQ.NS.Action", null /*entitySet*/, null /*documentation*/, testLocation);
     var csdlEntityContainer = CsdlBuilder.EntityContainer("Container", operationImports: new CsdlOperationImport[] { actionImport });
     var schema = CsdlBuilder.Schema("FQ.NS", csdlEntityContainers: new CsdlEntityContainer[] { csdlEntityContainer });
     var csdlModel = new CsdlModel();
     csdlModel.AddSchema(schema);
     var semanticSchema = new CsdlSemanticsSchema(new CsdlSemanticsModel(csdlModel, new EdmDirectValueAnnotationsManager(), Enumerable.Empty<IEdmModel>()), schema);
     
     CsdlSemanticsEntityContainer container = new CsdlSemanticsEntityContainer(semanticSchema, csdlEntityContainer);
     var imports = container.OperationImports().ToList();
     imports.Should().HaveCount(1);
     imports[0].Name.Should().Be("Action");
     imports[0].Operation.GetType().Should().Be(typeof(UnresolvedAction));
     var errors = imports[0].Operation.As<BadElement>().Errors.ToList();
     errors.Should().HaveCount(1);
     errors.First().ErrorMessage.Should().Be(Strings.Bad_UnresolvedOperation("FQ.NS.Action"));
     imports[0].Container.Name.Should().Be("Container");
     imports[0].Location().Should().Be(testLocation);
     imports[0].ContainerElementKind.Should().Be(EdmContainerElementKind.ActionImport);
     imports[0].EntitySet.Should().BeNull();
 }
开发者ID:rossjempson,项目名称:odata.net,代码行数:22,代码来源:CsdlSemanticsEntityContainerTests.cs


示例15: CsdlSemanticsLabeledExpressionReferenceExpression

 public CsdlSemanticsLabeledExpressionReferenceExpression(CsdlLabeledExpressionReferenceExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema)
     : base(schema, expression)
 {
     this.expression = expression;
     this.bindingContext = bindingContext;
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:6,代码来源:CsdlSemanticsLabeledExpressionReferenceExpression.cs


示例16: CsdlSemanticsStructuredTypeDefinition

 protected CsdlSemanticsStructuredTypeDefinition(CsdlSemanticsSchema context, CsdlStructuredType type)
     : base(type)
 {
     this.context = context;
 }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:5,代码来源:CsdlSemanticsStructuredTypeDefinition.cs


示例17: CsdlSemanticsFunction

 public CsdlSemanticsFunction(CsdlSemanticsSchema context, CsdlFunction function)
     : base(context, function)
 {
     this.function = function;
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:5,代码来源:CsdlSemanticsFunction.cs


示例18: CsdlSemanticsIsTypeExpression

 public CsdlSemanticsIsTypeExpression(CsdlIsTypeExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema)
     : base(schema, expression)
 {
     this.expression = expression;
     this.bindingContext = bindingContext;
 }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:6,代码来源:CsdlSemanticsIsTypeExpression.cs


示例19: CsdlSemanticsOperation

 public CsdlSemanticsOperation(CsdlSemanticsSchema context, CsdlOperation operation)
     : base(operation)
 {
     this.Context = context;
     this.operation = operation;
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:6,代码来源:CsdlSemanticsOperation.cs


示例20: CsdlSemanticsValueTerm

 public CsdlSemanticsValueTerm(CsdlSemanticsSchema context, CsdlValueTerm valueTerm)
     : base(valueTerm)
 {
     this.Context = context;
     this.valueTerm = valueTerm;
 }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:6,代码来源:CsdlSemanticsValueTerm.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Csla类代码示例发布时间:2022-05-24
下一篇:
C# CsTokenList类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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