src/Shared/EntityFramework/Core/Metadata/Edm/ObjectItemCollection.cs
// <summary>
// A helper method returning the underlying CLR type for the specified OSpace enum or structural type argument.
// If the DataSpace of the parameter is not OSpace, the method returns false and sets
// the out parameter to null.
// </summary>
// <param name="objectSpaceType"> The OSpace enum type to look up </param>
// <param name="clrType"> The CLR enum type of the OSpace argument </param>
// <returns> true on success, false on failure </returns>
A helper method returning the underlying CLR type for the specified OSpace enum or structural type argument.
If the DataSpace of the parameter is not OSpace, the method returns false and sets
the out parameter to null.
A helper method returning the underlying CLR type for the specified OSpace enum or structural type argument . If the DataSpace of the parameter is not OSpace the method returns false and sets the out parameter to null .
private static bool TryGetClrType(EdmType objectSpaceType, out Type clrType)
        {
            DebugCheck.NotNull(objectSpaceType);
            Debug.Assert(
                objectSpaceType == null || objectSpaceType is StructuralType || objectSpaceType is EnumType,
                "Only enum or structural type expected");
            if (objectSpaceType.DataSpace != DataSpace.OSpace)
            {
                throw new ArgumentException(Strings.ArgumentMustBeOSpaceType, "objectSpaceType");
            }
            clrType = null;
            if (Helper.IsEntityType(objectSpaceType)
                || Helper.IsComplexType(objectSpaceType)
                || Helper.IsEnumType(objectSpaceType))
            {
                Debug.Assert(
                    objectSpaceType is ClrEntityType || objectSpaceType is ClrComplexType || objectSpaceType is ClrEnumType,
                    "Unexpected OSpace object type.");
                clrType = objectSpaceType.ClrType;
                Debug.Assert(clrType != null, "ClrType property of ClrEntityType/ClrComplexType/ClrEnumType objects must not be null");
            }
            return clrType != null;
        }
private static bool TryGetClrType ( EdmType objectSpaceType , out Type clrType ) { DebugCheck . NotNull ( objectSpaceType ) ; Debug . Assert ( objectSpaceType == null || objectSpaceType is StructuralType || objectSpaceType is EnumType , " " ) ; if ( objectSpaceType . DataSpace != DataSpace . OSpace ) { throw new ArgumentException ( Strings . ArgumentMustBeOSpaceType , " " ) ; } clrType = null ; if ( Helper . IsEntityType ( objectSpaceType ) || Helper . IsComplexType ( objectSpaceType ) || Helper . IsEnumType ( objectSpaceType ) ) { Debug . Assert ( objectSpaceType is ClrEntityType || objectSpaceType is ClrComplexType || objectSpaceType is ClrEnumType , " " ) ; clrType = objectSpaceType . ClrType ; Debug . Assert ( clrType != null , " " ) ; } return clrType != null ; }
A helper method returning the underlying CLR type for the specified OSpace enum or structural type argument.
A helper method returning the underlying CLR type for the specified OSpace enum or structural type argument .
true on success, false on failure
true on success false on failure
objectSpaceType
EdmType
The OSpace enum type to look up
The OSpace enum type to look up
Type
out
clrType
The CLR enum type of the OSpace argument
The CLR enum type of the OSpace argument