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


C# CsdlSemanticsSchema类代码示例

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


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


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