EntityContainer 요소(CSDL)

CSDL(개념 스키마 정의 언어)에 정의된 EntityContainer는 개체 모델에서 EDM(엔터티 데이터 모델) 기반의 클래스 사양입니다. EntityContainer는 개체 모델에서 정의되는 엔터티와 연결의 범위를 제어합니다. 이러한 엔터티와 연결은 개별적으로 스키마에 정의된 다음 EntityContainer 정의 내부의 EntitySetAssociationSet 정의의 멤버로 정의됩니다.

XML 계층 구조에서 EntityContainer 요소는 EntityContainer가 스키마에 정의되었더라도 Schema 요소와 별개입니다. 이 점은 EntityContainer를 저장소에 매핑할 때 중요합니다. 개념 스키마의 EntityContainer 요소는 저장소 메타데이터에 있는 해당 EntityContainer 요소에 매핑됩니다. 매핑 파일에서 EntityContainer의 정규화된 이름에는 스키마 네임스페이스 이름이 포함되지 않습니다.

EntityContainer 매핑에 대한 자세한 내용은 EntityContainerMapping 요소(MSL)를 참조하십시오.

항목 및 엔터티 집합

Adventure Works Human Resources 스키마 예제의 EntityContainer에는 직원, 부서, 직원 주소, 직원 이력 등에 대한 엔터티 집합이 정의되어 있습니다. 다음 예제에는 AdventureWorksHRModel 네임스페이스의 일부로 정의된 EntityContainerHumanResources에 대한 선언과 정의가 CSDL 구문에 포함되어 있습니다.

  <EntityContainer Name="HumanResources">
    <EntitySet Name="Department" EntityType="Self.Department" />
    <EntitySet Name="Employee" EntityType="Self.Employee" />
    <EntitySet Name="EmployeeAddress" EntityType="Self.EmployeeAddress" />
    <EntitySet Name="EmployeeDepartmentHistory"
                      EntityType="Self.EmployeeDepartmentHistory" />
    <EntitySet Name="EmployeePayHistory"
                             EntityType="Self.EmployeePayHistory" />
    <EntitySet Name="JobCandidate" EntityType="Self.JobCandidate" />
    <EntitySet Name="Shift" EntityType="Self.Shift" />
    <AssociationSet Name="Employee_Employee_ManagerID"
                     Association="Self.Employee_Employee_ManagerID">
      <End Role="Employee" EntitySet="Employee" />
      <End Role="EmployeeManager" EntitySet="Employee" />
    </AssociationSet>
    <AssociationSet Name="JobCandidate_Employee_EmployeeID"
                Association="Self.JobCandidate_Employee_EmployeeID">
      <End Role="Employee" EntitySet="Employee" />
      <End Role="JobCandidate" EntitySet="JobCandidate" />
    </AssociationSet>
  </EntityContainer>

EntityContainer에 정의된 엔터티 집합 및 연결 집합에 대한 자세한 내용은 이 단원의 다음 항목을 참조하십시오.

Name 특성(EntityContainer CSDL)

EntitySet 요소(EntityContainer CSDL)

AssociationSet 요소(EntityContainer CSDL)

참고 항목

개념

Name 특성(EntityContainer CSDL)
엔터티 집합(EDM)
연결 집합(EDM)
EntityContainerMapping 요소(MSL)
AdventureWorks 전체 모델(EDM)