本文整理汇总了C#中Microsoft.OData.Edm.Library.EdmComplexTypeReference.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# EdmComplexTypeReference.ToString方法的具体用法?C# EdmComplexTypeReference.ToString怎么用?C# EdmComplexTypeReference.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.OData.Edm.Library.EdmComplexTypeReference
的用法示例。
在下文中一共展示了EdmComplexTypeReference.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConstructableTypeReferenceToStringTest
public void ConstructableTypeReferenceToStringTest()
{
IEdmEntityType astonishing = new EdmEntityType("AwesomeNamespace", "AstonishingEntity", null, false, false);
IEdmComplexType breathTaking = new EdmComplexType("AwesomeNamespace", "BreathtakingComplex", null, false);
IEdmEntityTypeReference entity = new EdmEntityTypeReference(astonishing, true);
IEdmComplexTypeReference complex = new EdmComplexTypeReference(breathTaking, true);
IEdmPrimitiveTypeReference primitive = EdmCoreModel.Instance.GetInt32(true);
IEdmStringTypeReference stringType = EdmCoreModel.Instance.GetString(false, 128, false, true);
IEdmBinaryTypeReference binary = EdmCoreModel.Instance.GetBinary(true, null, true);
IEdmTemporalTypeReference temporal = EdmCoreModel.Instance.GetTemporal(EdmPrimitiveTypeKind.DateTimeOffset, 1, true);
IEdmDecimalTypeReference decimalType = EdmCoreModel.Instance.GetDecimal(3, 2, true);
IEdmSpatialTypeReference spatial = EdmCoreModel.Instance.GetSpatial(EdmPrimitiveTypeKind.Geography, 1, true);
IEdmEntityReferenceTypeReference entityRef = new EdmEntityReferenceTypeReference(new EdmEntityReferenceType(astonishing), true);
IEdmCollectionTypeReference collection = EdmCoreModel.GetCollection(EdmCoreModel.Instance.GetInt32(true));
IEdmTypeReference type = new EdmEntityTypeReference(astonishing, true);
Assert.AreEqual("[AwesomeNamespace.AstonishingEntity Nullable=True]", entity.ToString(), "To string correct");
Assert.AreEqual("[AwesomeNamespace.BreathtakingComplex Nullable=True]", complex.ToString(), "To string correct");
Assert.AreEqual("[Edm.Int32 Nullable=True]", primitive.ToString(), "To string correct");
Assert.AreEqual("[Edm.String Nullable=True MaxLength=128 Unicode=False]", stringType.ToString(), "To string correct");
Assert.AreEqual("[Edm.Binary Nullable=True MaxLength=max]", binary.ToString(), "To string correct");
Assert.AreEqual("[Edm.DateTimeOffset Nullable=True Precision=1]", temporal.ToString(), "To string correct");
Assert.AreEqual("[Edm.Decimal Nullable=True Precision=3 Scale=2]", decimalType.ToString(), "To string correct");
Assert.AreEqual("[Edm.Geography Nullable=True SRID=1]", spatial.ToString(), "To string correct");
Assert.AreEqual("[Collection([Edm.Int32 Nullable=True]) Nullable=True]", collection.ToString(), "To string correct");
Assert.AreEqual("[EntityReference(AwesomeNamespace.AstonishingEntity) Nullable=True]", entityRef.ToString(), "To string correct");
Assert.AreEqual("[AwesomeNamespace.AstonishingEntity Nullable=True]", type.ToString(), "To string correct");
}