本文整理汇总了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();
}
示例2: CsdlSemanticsPrimitiveTypeReference
public CsdlSemanticsPrimitiveTypeReference(CsdlSemanticsSchema schema, CsdlPrimitiveTypeReference reference)
: base(reference)
{
this.schema = schema;
this.Reference = reference;
this.definition = EdmCoreModel.Instance.GetPrimitiveType(this.Reference.Kind);
}
示例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;
}
示例4: CsdlSemanticsApplyExpression
public CsdlSemanticsApplyExpression(CsdlApplyExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema)
: base(schema, expression)
{
this.expression = expression;
this.bindingContext = bindingContext;
this.schema = schema;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例15: CsdlSemanticsLabeledExpressionReferenceExpression
public CsdlSemanticsLabeledExpressionReferenceExpression(CsdlLabeledExpressionReferenceExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema)
: base(schema, expression)
{
this.expression = expression;
this.bindingContext = bindingContext;
}