次の方法で共有


FunctionImportMapping 要素 (MSL)

マッピング仕様言語 (MSL) の FunctionImportMapping 要素は、概念モデルの関数インポートと基になるデータベースのストアド プロシージャまたは関数の間のマッピングを定義します。 関数インポートは概念モデル内で、ストアド プロシージャはストレージ モデル内で宣言する必要があります。 詳細については、「FunctionImport 要素 (CSDL)」および「Function 要素 (SSDL)」を参照してください。

Cc716759.note(ja-jp,VS.100).gif注 :
既定では、関数インポートが概念モデル エンティティ型または複合型を返す場合、基になるストアド プロシージャが返す列の名前が概念モデル型のプロパティの名前と正確に一致する必要があります。列の名前がプロパティの名前と完全には一致しない場合は、ResultMapping 要素でマッピングを定義する必要があります。

The FunctionImportMapping element can have the following child elements:

適用可能な属性

The following table describes the attributes that are applicable to the FunctionImportMapping element:

属性名 必須 Value

FunctionImportName

有効

マップされる概念モデルの関数インポートの名前。

FunctionName

有効

マップされるストレージ モデルの関数の名前空間修飾名。

The following example is based on the School model. ストレージ モデルの次の関数について考えます。

<Function Name="GetStudentGrades" Aggregate="false" 
          BuiltIn="false" NiladicFunction="false" 
          IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" 
          Schema="dbo">
  <Parameter Name="StudentID" Type="int" Mode="In" />
</Function>

また、概念モデルのこの関数インポートについて考えます。

<FunctionImport Name="GetStudentGrades" EntitySet="StudentGrades" 
                ReturnType="Collection(SchoolModel.StudentGrade)">
  <Parameter Name="StudentID" Mode="In" Type="Int32" />
</FunctionImport>

次の例は、上記の関数および関数インポートを互いにマップするのに使用する FunctionImportMapping 要素を示します。

<FunctionImportMapping FunctionImportName="GetStudentGrades"
                       FunctionName="SchoolModel.Store.GetStudentGrades" />

参照

その他のリソース

CSDL、SSDL、および MSL 仕様
モデリングとマッピング (Entity Framework)
How to: Import a Stored Procedure