MySQL的实体框架4.0存储过程字段映射 [英] MySQL Entity Framework 4.0 Stored Procedure Field Mapping
问题描述
有没有人在这里使用的MySQL与实体框架4.0和存储过程?当我加入一个SP,它不显示我的任何领域,我需要投入的。我也看不出有什么方法来手动添加。当我点击功能导入映射,它只是说对实体设计模型浏览器中选择一个实体或协会来编辑它的映射。
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".
任何帮助是AP preciated。我现在用的是.NET连接器6.3.6
Any help is appreciated. I am using the .NET Connector 6.3.6
推荐答案
由于错误#55778(存储过程的参数是实体数据模型的更新过程中略)这是不可能自动导入MySQL的存储过程转换成一个实体,数据模型。
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.
作为一种解决方法,你可以手动操作创建.edmx文件(.ssdl,.csdl):
As a workaround you could manually manipulate the created .edmx file (.ssdl, .csdl):
导入存储过程的MySQL作为discribed上述
Import the MySQL Stored Procedure as discribed above
模型(.edmx文件或.ssdl,.csdl文件)中搜索存储过程的名称
Search for the Stored Procedure name within the model (.edmx file or .ssdl, .csdl files)
中的存储模型(SSDL)代替:
Within the Storage Model (SSDL) replace:
<Function Name="GetStudentGrades" Aggregate="false" BuiltIn="false"
NiladicFunction="false" IsComposable="false"
ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
</Function>
与
<Function Name="GetStudentGrades" Aggregate="false" BuiltIn="false"
NiladicFunction="false" IsComposable="false"
ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
<Parameter Name="StudentID" Type="int" Mode="In" />
</Function>
在概念模型(CSDL)替换:
Within the Conceptual Model (CSDL) replace:
<FunctionImport Name="GetStudentGrades" EntitySet="StudentGrades" ReturnType=...>
</FunctionImport>
与
<FunctionImport Name="GetStudentGrades" EntitySet="StudentGrades" ReturnType=...>
<Parameter Name="StudentID" Mode="In" Type="Int32" />
</FunctionImport>
希望帮助! 干杯
Hope that helps! Cheers
这篇关于MySQL的实体框架4.0存储过程字段映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!