GlobalItem 클래스

정의

모든 개념적 모델 형식 및 엔터티 컨테이너에 대한 기본 항목 클래스를 나타냅니다.

public ref class GlobalItem abstract : System::Data::Metadata::Edm::MetadataItem
public abstract class GlobalItem : System.Data.Metadata.Edm.MetadataItem
type GlobalItem = class
    inherit MetadataItem
Public MustInherit Class GlobalItem
Inherits MetadataItem
상속
GlobalItem
파생

예제

다음 코드 샘플에서는 연결에서 메타데이터 작업 영역을 가져온 다음 이 메타데이터 작업 영역을 사용하여 메타데이터 형식 계층 구조를 탐색하는 방법을 보여 줍니다. 메타데이터 작업 영역은 메타데이터 검색을 지원하는 런타임 서비스 구성 요소입니다.

코드 샘플에서는 CSpace를 사용하여 모델을 지정합니다. CSpace는 개념적 모델의 기본 이름을 나타냅니다. 코드 샘플은 애플리케이션 구성 파일에 제공되는 연결 문자열 사용합니다.

using System;  
using System.Data;  
using System.Data.EntityClient;  
using System.Data.Metadata.Edm;  
using System.Collections.ObjectModel;  

class BrowseTypes  
{  
  static void Main()  
  {  
    try  
    {  
      // Establish a connection to the underlying data provider by  
      // using the connection string specified in the config file.  
      using (EntityConnection connection =  
             new EntityConnection("Name=AdventureworksContext"))  
      {  
         // Access the metadata workspace.  
         MetadataWorkspace workspace =   
              connection.GetMetadataWorkspace();  
         // Browse the metadata type hierarchy.  
         BrowseTypesExample(workspace);  
      }  
    }  
    catch (MetadataException exceptionMetadata)  
    {  
       Console.WriteLine("MetadataException: {0}",  
                         exceptionMetadata.Message);  
     }  
     catch (System.Data.MappingException exceptionMapping)  
     {  
        Console.WriteLine("MappingException: {0}",  
                          exceptionMapping.Message);  
     }  
  }  

  private static void BrowseTypesExample(MetadataWorkspace workspace)  
  {  
    // Get a collection of the GlobalItems.   
    // An GlobalItem class is the base class for   
    // the conceptual model types and entity containers.  
    ReadOnlyCollection<GlobalItem> items =   
         workspace.GetItems<GlobalItem>(DataSpace.CSpace);  

    // Iterate through the collection to get each item.  
    foreach (GlobalItem item in items)  
    {  
       Console.WriteLine(  
           "Item BuiltInTypeKind: {0}, Type: {1} ",   
           item.BuiltInTypeKind, item.GetType().FullName);  

       EntityContainer entityContainer = item as EntityContainer;  
       if (entityContainer != null)  
       {  
          Console.WriteLine(  
               "EntityContainer Name: {0}",  
               entityContainer.Name);  
          continue;  
       }  

       EntityType entityType = item as EntityType;  
       if (entityType != null)  
       {  
         Console.WriteLine(  
             "EntityType Name: {0}, Namespace: {1}",  
             entityType.Name, entityType.NamespaceName);  
        continue;  
       }  

       AssociationType associationType = item as AssociationType;  
       if (associationType != null)  
       {  
          Console.WriteLine(  
             "AssociationType Name: {0}, Namespace: {1}",  
             associationType.Name, associationType.NamespaceName);  
          continue;  
       }  

       PrimitiveType primType = item as PrimitiveType;  
       if (primType != null)  
       {  
         Console.WriteLine(  
             "PrimitiveType Name: {0}, Namespace: {1}",   
             primType.Name, primType.NamespaceName);  
         continue;  
       }  

       EdmFunction function = item as EdmFunction;  
       if (function != null)  
       {  
         Console.WriteLine(  
           "EdmFunction Name: {0}, Namespace: {1}",  
           function.Name, function.NamespaceName);  
         continue;  
       }  
    }  
  }  
}  

속성

BuiltInTypeKind

이 형식의 기본 제공 형식 유형을 가져옵니다.

(다음에서 상속됨 MetadataItem)
Documentation

이 형식과 관련된 설명서를 가져오거나 설정합니다.

(다음에서 상속됨 MetadataItem)
MetadataProperties

현재 형식의 속성 목록을 가져옵니다.

(다음에서 상속됨 MetadataItem)

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상