internal static IEdmTypeReference GetCollectionItemType(this IEdmTypeReference typeReference) { IEdmCollectionTypeReference type = typeReference.AsCollectionOrNull(); if (type != null) { return(type.ElementType()); } return(null); }
internal static IEdmCollectionTypeReference ValidateCollectionType(IEdmTypeReference typeReference) { IEdmCollectionTypeReference reference = typeReference.AsCollectionOrNull(); if ((reference != null) && !typeReference.IsNonEntityODataCollectionTypeKind()) { throw new ODataException(Microsoft.Data.OData.Strings.ValidationUtils_InvalidCollectionTypeReference(typeReference.TypeKind())); } return(reference); }
/// <summary> /// Validates that the <paramref name="typeReference"/> represents a collection type. /// </summary> /// <param name="typeReference">The type reference to validate.</param> /// <returns>The <see cref="IEdmCollectionTypeReference"/> instance representing the collection passed as <paramref name="typeReference"/>.</returns> internal static IEdmCollectionTypeReference ValidateCollectionType(IEdmTypeReference typeReference) { IEdmCollectionTypeReference collectionTypeReference = typeReference.AsCollectionOrNull(); if (collectionTypeReference != null && !typeReference.IsNonEntityCollectionType()) { throw new ODataException(Strings.ValidationUtils_InvalidCollectionTypeReference(typeReference.TypeKind())); } return(collectionTypeReference); }
/// <summary> /// Validates that the <paramref name="typeReference"/> represents a collection type. /// </summary> /// <param name="typeReference">The type reference to validate.</param> /// <returns>The <see cref="IEdmCollectionTypeReference"/> instance representing the collection passed as <paramref name="typeReference"/>.</returns> public IEdmCollectionTypeReference ValidateCollectionType(IEdmTypeReference typeReference) { return(typeReference.AsCollectionOrNull()); }
/// <summary> /// Validates that the <paramref name="typeReference"/> represents a collection type. /// </summary> /// <param name="typeReference">The type reference to validate.</param> /// <returns>The <see cref="IEdmCollectionTypeReference"/> instance representing the collection passed as <paramref name="typeReference"/>.</returns> internal static IEdmCollectionTypeReference ValidateCollectionType(IEdmTypeReference typeReference) { IEdmCollectionTypeReference collectionTypeReference = typeReference.AsCollectionOrNull(); if (collectionTypeReference != null && !typeReference.IsNonEntityCollectionType()) { throw new ODataException(Strings.ValidationUtils_InvalidCollectionTypeReference(typeReference.TypeKind())); } return collectionTypeReference; }
internal static IEdmCollectionTypeReference ValidateCollectionType(IEdmTypeReference typeReference) { IEdmCollectionTypeReference reference = typeReference.AsCollectionOrNull(); if ((reference != null) && !typeReference.IsNonEntityODataCollectionTypeKind()) { throw new ODataException(Microsoft.Data.OData.Strings.ValidationUtils_InvalidCollectionTypeReference(typeReference.TypeKind())); } return reference; }
/// <summary> /// Validates that the <paramref name="typeReference"/> represents a collection type. /// </summary> /// <param name="typeReference">The type reference to validate.</param> /// <returns>The <see cref="IEdmCollectionTypeReference"/> instance representing the collection passed as <paramref name="typeReference"/>.</returns> public IEdmCollectionTypeReference ValidateCollectionType(IEdmTypeReference typeReference) { return typeReference.AsCollectionOrNull(); }