internal static IEdmStructuredTypeReference AsStructuredOrNull(this IEdmTypeReference typeReference) { if (typeReference == null) { return null; } if (!typeReference.IsStructured()) { return null; } return typeReference.AsStructured(); }
/// <summary> /// Casts an <see cref="IEdmTypeReference"/> to a <see cref="IEdmStructuredTypeReference"/> or returns null if this is not supported. /// </summary> /// <param name="typeReference">The type reference to convert.</param> /// <returns>An <see cref="IEdmStructuredTypeReference"/> instance or null if the <paramref name="typeReference"/> cannot be converted.</returns> internal static IEdmStructuredTypeReference AsStructuredOrNull(this IEdmTypeReference typeReference) { DebugUtils.CheckNoExternalCallers(); if (typeReference == null) { return null; } return typeReference.IsStructured() ? typeReference.AsStructured() : null; }