MySQL Entity Framework 4.0 Stored Procedure Field Mapping

半世苍凉 提交于 2019-11-29 06:19:19
wickiy

due to the bug #55778 (Stored procedure parameters are omitted during update of the entity data model) it is not possible to automatically import MySQL Stored Procedures into a entity data model.

As a workaround you could manually manipulate the created .edmx file (.ssdl, .csdl):

Import the MySQL Stored Procedure as discribed above

Search for the Stored Procedure name within the model (.edmx file or .ssdl, .csdl files)

Within the Storage Model (SSDL) replace:

  <Function Name="GetStudentGrades" Aggregate="false" BuiltIn="false"
            NiladicFunction="false" IsComposable="false"
            ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
  </Function>

with:

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

Within the Conceptual Model (CSDL) replace:

  <FunctionImport Name="GetStudentGrades" EntitySet="StudentGrades" ReturnType=...>
  </FunctionImport>

with:

  <FunctionImport Name="GetStudentGrades" EntitySet="StudentGrades" ReturnType=...>
    <Parameter Name="StudentID" Mode="In" Type="Int32" />
  </FunctionImport>

Hope that helps! Cheers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!