本文整理汇总了C#中IEdmType.IsNonEntityODataCollectionTypeKind方法的典型用法代码示例。如果您正苦于以下问题:C# IEdmType.IsNonEntityODataCollectionTypeKind方法的具体用法?C# IEdmType.IsNonEntityODataCollectionTypeKind怎么用?C# IEdmType.IsNonEntityODataCollectionTypeKind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEdmType
的用法示例。
在下文中一共展示了IEdmType.IsNonEntityODataCollectionTypeKind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VerifyCollectionComplexItemType
/// <summary>
/// Verifies that in case of collection types, the item type is valid.
/// </summary>
/// <param name="expectedTypeReference">The expected type reference.</param>
/// <param name="payloadType">The payload type.</param>
/// <remarks>
/// This method verifies that item type is not a derived complex type, we want to explicitly disallow that case for possible future enablement.
/// </remarks>
private static void VerifyCollectionComplexItemType(IEdmTypeReference expectedTypeReference, IEdmType payloadType)
{
Debug.Assert(expectedTypeReference != null, "expectedTypeReference != null");
Debug.Assert(payloadType != null, "payloadType != null");
Debug.Assert(expectedTypeReference.IsNonEntityODataCollectionTypeKind(), "This method only works on atomic collections.");
Debug.Assert(payloadType.IsNonEntityODataCollectionTypeKind(), "This method only works on atomic collections.");
IEdmCollectionTypeReference collectionTypeReference = ValidationUtils.ValidateCollectionType(expectedTypeReference);
IEdmTypeReference expectedItemTypeReference = collectionTypeReference.GetCollectionItemType();
if (expectedItemTypeReference != null && expectedItemTypeReference.IsODataComplexTypeKind())
{
IEdmCollectionTypeReference payloadCollectionTypeReference = ValidationUtils.ValidateCollectionType(payloadType.ToTypeReference());
IEdmTypeReference payloadItemTypeReference = payloadCollectionTypeReference.GetCollectionItemType();
if (payloadItemTypeReference != null && payloadItemTypeReference.IsODataComplexTypeKind())
{
// Note that this method is called from both strict and lax code paths, so we must not fail if the types are not related.
// The strict caller will fail if the types are not equal after this method returns. We use this method there to only get
// a more specific error message if the derived complex types are used.
VerifyComplexType(expectedItemTypeReference, payloadItemTypeReference.Definition, /* failIfNotRelated */ false);
}
}
}