/// <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, an ArgumentException is thrown. /// </summary> /// <param name="objectSpaceType">The OSpace type to look up</param> /// <returns>The CLR type of the OSpace argument</returns> private static Type GetClrType(EdmType objectSpaceType) { Debug.Assert(objectSpaceType == null || objectSpaceType is StructuralType || objectSpaceType is EnumType, "Only enum or structural type expected"); Type clrType; if (!ObjectItemCollection.TryGetClrType(objectSpaceType, out clrType)) { throw EntityUtil.Argument(Strings.FailedToFindClrTypeMapping(objectSpaceType.Identity)); } return(clrType); }
/// <summary> /// The method returns the underlying CLR type for the specified OSpace enum 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> public bool TryGetClrType(EnumType objectSpaceType, out Type clrType) { return(ObjectItemCollection.TryGetClrType((EdmType)objectSpaceType, out clrType)); }