本文整理汇总了C#中Microsoft.OData.Edm.Library.EdmComplexTypeReference.IsComplex方法的典型用法代码示例。如果您正苦于以下问题:C# EdmComplexTypeReference.IsComplex方法的具体用法?C# EdmComplexTypeReference.IsComplex怎么用?C# EdmComplexTypeReference.IsComplex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.OData.Edm.Library.EdmComplexTypeReference
的用法示例。
在下文中一共展示了EdmComplexTypeReference.IsComplex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NonPrimitiveIsXXXMethods
public void NonPrimitiveIsXXXMethods()
{
IEdmEntityType entityDef = new EdmEntityType("MyNamespace", "MyEntity");
IEdmEntityTypeReference entityRef = new EdmEntityTypeReference(entityDef, false);
Assert.IsTrue(entityRef.IsEntity(), "Entity is Entity");
IEdmPrimitiveTypeReference bad = entityRef.AsPrimitive();
Assert.IsTrue(bad.Definition.IsBad(), "bad TypeReference is bad");
Assert.AreEqual(EdmErrorCode.TypeSemanticsCouldNotConvertTypeReference, bad.Definition.Errors().First().ErrorCode, "Reference is bad from conversion");
Assert.IsTrue(bad.Definition.IsBad(), "Bad definition is bad");
Assert.AreEqual(EdmErrorCode.TypeSemanticsCouldNotConvertTypeReference, bad.Definition.Errors().First().ErrorCode, "Definition is bad from conversion");
IEdmPrimitiveType intDef = EdmCoreModel.Instance.GetPrimitiveType(EdmPrimitiveTypeKind.Int32);
IEdmPrimitiveTypeReference intRef = new EdmPrimitiveTypeReference(intDef, false);
IEdmCollectionTypeReference intCollection = new EdmCollectionTypeReference(new EdmCollectionType(intRef));
Assert.IsTrue(intCollection.IsCollection(), "Collection is collection");
IEdmComplexType complexDef = new EdmComplexType("MyNamespace", "MyComplex");
IEdmComplexTypeReference complexRef = new EdmComplexTypeReference(complexDef, false);
Assert.IsTrue(complexRef.IsComplex(), "Complex is Complex");
Assert.IsTrue(entityRef.IsStructured(), "Entity is Structured");
Assert.IsTrue(complexRef.IsStructured(), "Complex is stuctured");
Assert.IsFalse(intCollection.IsStructured(), "Collection is not structured");
}