Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Has anyone here used MySQL with the entity framework 4.0 and stored procedures? When I add a SP, it does not show any of my fields that I need to input. I also see no way to manually add them. When I click Function Import Mapping, it simply says "Select an Entity or Association on the Entity Designer Model Browser to edit it's mapping".

Any help is appreciated. I am using the .NET Connector 6.3.6

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
487 views
Welcome To Ask or Share your Answers For Others

1 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...