AdventureWorks 销售映射架构 (EDM)

实体数据模型 (EDM) 映射规范将概念性模型的实体和关联映射到存储元数据中的实体和关联。

MSL 架构

映射架构用映射规范语言 (MSL) 编写。有关 MSL 语法的更多信息,请参见架构和映射规范(实体框架)

<?xml version="1.0" encoding="utf-8"?>
<Mapping Space="C-S" xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
  <EntityContainerMapping StorageEntityContainer="Person" CdmEntityContainer="AdvWksSalesEntities">
    <EntitySetMapping Name="Address">
      <EntityTypeMapping TypeName="IsTypeOf(AdvWrksSalesModel.Address)">
        <MappingFragment StoreEntitySet="Address">
          <ScalarProperty Name="AddressID" ColumnName="AddressID" />
          <ScalarProperty Name="AddressLine1" ColumnName="AddressLine1" />
          <ScalarProperty Name="AddressLine2" ColumnName="AddressLine2" />
          <ScalarProperty Name="City" ColumnName="City" />
          <ScalarProperty Name="StateProvinceID" ColumnName="StateProvinceID" />
          <ScalarProperty Name="PostalCode" ColumnName="PostalCode" />
          <ScalarProperty Name="rowguid" ColumnName="rowguid" />
          <ScalarProperty Name="ModifiedDate" ColumnName="ModifiedDate" />
        </MappingFragment>
      </EntityTypeMapping>
    </EntitySetMapping>
    <EntitySetMapping Name="Contact">
      <EntityTypeMapping TypeName="IsTypeOf(AdvWrksSalesModel.Contact)">
        <MappingFragment StoreEntitySet="Contact">
          <ScalarProperty Name="ContactID" ColumnName="ContactID" />
          <ScalarProperty Name="NameStyle" ColumnName="NameStyle" />
          <ScalarProperty Name="Title" ColumnName="Title" />
          <ScalarProperty Name="FirstName" ColumnName="FirstName" />
          <ScalarProperty Name="MiddleName" ColumnName="MiddleName" />
          <ScalarProperty Name="LastName" ColumnName="LastName" />
          <ScalarProperty Name="Suffix" ColumnName="Suffix" />
          <ScalarProperty Name="EmailAddress" ColumnName="EmailAddress" />
          <ScalarProperty Name="EmailPromotion" ColumnName="EmailPromotion" />
          <ScalarProperty Name="Phone" ColumnName="Phone" />
          <ScalarProperty Name="PasswordHash" ColumnName="PasswordHash" />
          <ScalarProperty Name="PasswordSalt" ColumnName="PasswordSalt" />
          <ScalarProperty Name="AdditionalContactInfo" ColumnName="AdditionalContactInfo" />
          <ScalarProperty Name="rowguid" ColumnName="rowguid" />
          <ScalarProperty Name="ModifiedDate" ColumnName="ModifiedDate" />
        </MappingFragment>
      </EntityTypeMapping>
    </EntitySetMapping>
    <EntitySetMapping Name="Product">
      <EntityTypeMapping TypeName="IsTypeOf(AdvWrksSalesModel.Product)">
        <MappingFragment StoreEntitySet="Product">
          <ScalarProperty Name="ProductID" ColumnName="ProductID" />
          <ScalarProperty Name="Name" ColumnName="Name" />
          <ScalarProperty Name="ProductNumber" ColumnName="ProductNumber" />
          <ScalarProperty Name="MakeFlag" ColumnName="MakeFlag" />
          <ScalarProperty Name="FinishedGoodsFlag" ColumnName="FinishedGoodsFlag" />
          <ScalarProperty Name="Color" ColumnName="Color" />
          <ScalarProperty Name="SafetyStockLevel" ColumnName="SafetyStockLevel" />
          <ScalarProperty Name="ReorderPoint" ColumnName="ReorderPoint" />
          <ScalarProperty Name="StandardCost" ColumnName="StandardCost" />
          <ScalarProperty Name="ListPrice" ColumnName="ListPrice" />
          <ScalarProperty Name="Size" ColumnName="Size" />
          <ScalarProperty Name="SizeUnitMeasureCode" ColumnName="SizeUnitMeasureCode" />
          <ScalarProperty Name="WeightUnitMeasureCode" ColumnName="WeightUnitMeasureCode" />
          <ScalarProperty Name="Weight" ColumnName="Weight" />
          <ScalarProperty Name="DaysToManufacture" ColumnName="DaysToManufacture" />
          <ScalarProperty Name="ProductLine" ColumnName="ProductLine" />
          <ScalarProperty Name="Class" ColumnName="Class" />
          <ScalarProperty Name="Style" ColumnName="Style" />
          <ScalarProperty Name="ProductSubcategoryID" ColumnName="ProductSubcategoryID" />
          <ScalarProperty Name="ProductModelID" ColumnName="ProductModelID" />
          <ScalarProperty Name="SellStartDate" ColumnName="SellStartDate" />
          <ScalarProperty Name="SellEndDate" ColumnName="SellEndDate" />
          <ScalarProperty Name="DiscontinuedDate" ColumnName="DiscontinuedDate" />
          <ScalarProperty Name="rowguid" ColumnName="rowguid" />
          <ScalarProperty Name="ModifiedDate" ColumnName="ModifiedDate" />
        </MappingFragment>
      </EntityTypeMapping>
    </EntitySetMapping>
    <EntitySetMapping Name="SalesOrderDetail">
      <EntityTypeMapping TypeName="IsTypeOf(AdvWrksSalesModel.SalesOrderDetail)">
        <MappingFragment StoreEntitySet="SalesOrderDetail">
          <ScalarProperty Name="SalesOrderID" ColumnName="SalesOrderID" />
          <ScalarProperty Name="SalesOrderDetailID" ColumnName="SalesOrderDetailID" />
          <ScalarProperty Name="CarrierTrackingNumber" ColumnName="CarrierTrackingNumber" />
          <ScalarProperty Name="OrderQty" ColumnName="OrderQty" />
          <ScalarProperty Name="ProductID" ColumnName="ProductID" />
          <ScalarProperty Name="SpecialOfferID" ColumnName="SpecialOfferID" />
          <ScalarProperty Name="UnitPrice" ColumnName="UnitPrice" />
          <ScalarProperty Name="UnitPriceDiscount" ColumnName="UnitPriceDiscount" />
          <ScalarProperty Name="LineTotal" ColumnName="LineTotal" />
          <ScalarProperty Name="rowguid" ColumnName="rowguid" />
          <ScalarProperty Name="ModifiedDate" ColumnName="ModifiedDate" />
        </MappingFragment>
      </EntityTypeMapping>
    </EntitySetMapping>
    <EntitySetMapping Name="SalesOrderHeader">
      <EntityTypeMapping TypeName="IsTypeOf(AdvWrksSalesModel.SalesOrderHeader)">
        <MappingFragment StoreEntitySet="SalesOrderHeader">
          <ScalarProperty Name="SalesOrderID" ColumnName="SalesOrderID" />
          <ScalarProperty Name="RevisionNumber" ColumnName="RevisionNumber" />
          <ScalarProperty Name="OrderDate" ColumnName="OrderDate" />
          <ScalarProperty Name="DueDate" ColumnName="DueDate" />
          <ScalarProperty Name="ShipDate" ColumnName="ShipDate" />
          <ScalarProperty Name="Status" ColumnName="Status" />
          <ScalarProperty Name="OnlineOrderFlag" ColumnName="OnlineOrderFlag" />
          <ScalarProperty Name="SalesOrderNumber" ColumnName="SalesOrderNumber" />
          <ScalarProperty Name="PurchaseOrderNumber" ColumnName="PurchaseOrderNumber" />
          <ScalarProperty Name="AccountNumber" ColumnName="AccountNumber" />
          <ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
          <ScalarProperty Name="SalesPersonID" ColumnName="SalesPersonID" />
          <ScalarProperty Name="TerritoryID" ColumnName="TerritoryID" />
          <ScalarProperty Name="ShipMethodID" ColumnName="ShipMethodID" />
          <ScalarProperty Name="CreditCardID" ColumnName="CreditCardID" />
          <ScalarProperty Name="CreditCardApprovalCode" ColumnName="CreditCardApprovalCode" />
          <ScalarProperty Name="CurrencyRateID" ColumnName="CurrencyRateID" />
          <ScalarProperty Name="SubTotal" ColumnName="SubTotal" />
          <ScalarProperty Name="TaxAmt" ColumnName="TaxAmt" />
          <ScalarProperty Name="Freight" ColumnName="Freight" />
          <ScalarProperty Name="TotalDue" ColumnName="TotalDue" />
          <ScalarProperty Name="Comment" ColumnName="Comment" />
          <ScalarProperty Name="rowguid" ColumnName="rowguid" />
          <ScalarProperty Name="ModifiedDate" ColumnName="ModifiedDate" />
        </MappingFragment>
      </EntityTypeMapping>
    </EntitySetMapping>
    <AssociationSetMapping Name="FK_SalesOrderHeader_Address_BillToAddressID" TypeName="AdvWrksSalesModel.FK_SalesOrderHeader_Address_BillToAddressID" StoreEntitySet="SalesOrderHeader">
      <EndProperty Name="Address">
        <ScalarProperty Name="AddressID" ColumnName="BillToAddressID" />
      </EndProperty>
      <EndProperty Name="SalesOrderHeader">
        <ScalarProperty Name="SalesOrderID" ColumnName="SalesOrderID" />
      </EndProperty>
    </AssociationSetMapping>
    <AssociationSetMapping Name="FK_SalesOrderHeader_Address_ShipToAddressID" TypeName="AdvWrksSalesModel.FK_SalesOrderHeader_Address_ShipToAddressID" StoreEntitySet="SalesOrderHeader">
      <EndProperty Name="Address">
        <ScalarProperty Name="AddressID" ColumnName="ShipToAddressID" />
      </EndProperty>
      <EndProperty Name="SalesOrderHeader">
        <ScalarProperty Name="SalesOrderID" ColumnName="SalesOrderID" />
      </EndProperty>
    </AssociationSetMapping>
    <AssociationSetMapping Name="FK_SalesOrderHeader_Contact_ContactID" TypeName="AdvWrksSalesModel.FK_SalesOrderHeader_Contact_ContactID" StoreEntitySet="SalesOrderHeader">
      <EndProperty Name="Contact">
        <ScalarProperty Name="ContactID" ColumnName="ContactID" />
      </EndProperty>
      <EndProperty Name="SalesOrderHeader">
        <ScalarProperty Name="SalesOrderID" ColumnName="SalesOrderID" />
      </EndProperty>
    </AssociationSetMapping>
    <AssociationSetMapping Name="FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID" TypeName="AdvWrksSalesModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID" StoreEntitySet="SalesOrderDetail">
      <EndProperty Name="SalesOrderHeader">
        <ScalarProperty Name="SalesOrderID" ColumnName="SalesOrderID" />
      </EndProperty>
      <EndProperty Name="SalesOrderDetail">
        <ScalarProperty Name="SalesOrderID" ColumnName="SalesOrderID" />
        <ScalarProperty Name="SalesOrderDetailID" ColumnName="SalesOrderDetailID" />
      </EndProperty>
    </AssociationSetMapping>
  </EntityContainerMapping>
</Mapping>

另请参见

概念

AdventureWorks 销售概念架构 (EDM)
AdventureWorks 销售存储架构 (EDM)
AdventureWorks 销售连接 (EDM)