패싯(EDM)

EDM(엔터티 데이터 모델)에서 패싯은 엔터티의 속성으로 선언된 데이터 형식의 제약 조건을 나타냅니다. CSDL(개념 스키마 정의 언어)에서 Entity Framework는 패싯을 사용하지 않습니다. SSDL(저장소 스키마 정의 언어)에서 패싯은 데이터 소스에 사용된 데이터 형식 및 데이터베이스 관리 시스템에서 제공할 수 있는 제약 조건에 대한 정보를 제공합니다.

ProductEntityType의 다음 SSDL 선언에서 MaxLength, Nullable, Precision, ScaleStoreGeneratedPattern과 같은 속성 특성은 패싯입니다. StoreGeneratedPattern="Identity" 패싯이 있는 속성은 데이터베이스 테이블의 기본 키입니다. StoreGeneratedPattern 특성으로 데코레이팅된 속성은 데이터베이스 관리 시스템에서 자동으로 할당됩니다. 테이블의 이 열에 매핑된 엔터티의 속성은 응용 프로그램 코드에서 설정되지 않으며, 속성 설정에 사용되는 모든 코드는 데이터 소스에서 예외를 생성합니다.

<EntityType Name="Product">
  <Key>
    <PropertyRef Name="ProductID" />
  </Key>
  <Property Name="ProductID" Type="int" Nullable="false"
                      StoreGeneratedPattern="Identity" />
  <Property Name="Name" Type="nvarchar" 
                      Nullable="false" MaxLength="50" />
  <Property Name="ProductNumber" 
                    Type="nvarchar" Nullable="false" MaxLength="25"/>
  <Property Name="MakeFlag" Type="bit" Nullable="false" />
  <Property Name="FinishedGoodsFlag" 
                    Type="bit" Nullable="false" />
  <Property Name="Color" Type="nvarchar" MaxLength="15" />
  <Property Name="SafetyStockLevel" Type="smallint" Nullable="false"/>
  <Property Name="ReorderPoint" Type="smallint" Nullable="false" />
  <Property Name="StandardCost" Type="money" Nullable="false" />
  <Property Name="ListPrice" Type="money" Nullable="false" />
  <Property Name="Size" Type="nvarchar" MaxLength="5" />
  <Property Name="SizeUnitMeasureCode" Type="nchar" MaxLength="3" />
  <Property Name="WeightUnitMeasureCode" Type="nchar" MaxLength="3"/>
  <Property Name="Weight" Type="decimal" Precision="8" Scale="2" />
  <Property Name="DaysToManufacture" Type="int" Nullable="false" />
  <Property Name="ProductLine" Type="nchar" MaxLength="2" />
  <Property Name="Class" Type="nchar" MaxLength="2" />
  <Property Name="Style" Type="nchar" MaxLength="2" />
  <Property Name="ProductSubcategoryID" Type="int" />
  <Property Name="ProductModelID" Type="int" />
  <Property Name="SellStartDate" Type="datetime" Nullable="false" />
  <Property Name="SellEndDate" Type="datetime" />
  <Property Name="DiscontinuedDate" Type="datetime" />
  <Property Name="rowguid" Type="uniqueidentifier" Nullable="false" />
  <Property Name="ModifiedDate" Type="datetime" Nullable="false" />
</EntityType>

CSDL의 패싯은 디자인 중인 개체 모델에 영향을 주지 않습니다. Entity Designer는 패싯이 데코레이팅하는 속성의 데이터 형식이 변경될 경우 패싯을 제거합니다. 위에 표시된 SSDL의 StoreGeneratedPattern에 해당하는 CSDL의 병렬 특성은 CSDL에 지정할 경우 컴파일러 오류를 발생시키지 않습니다.

참고 항목

참조

Facet