使用了MySQL数据库和模型设计的实体框架不皮卡存储过程的参数 [英] Using the entity framework with a MySQL DB and the model designer doesn't pickup stored proc parameters

查看:113
本文介绍了使用了MySQL数据库和模型设计的实体框架不皮卡存储过程的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经得到了最新的MySQL连接器,使您可以使用Visual Studio实体框架设计。它一直工作很好,但我只是增加了一个存储过程。



在服务器资源管理器加载它,罚款与指定的参数,但后来我把它添加到实体模型和放大器;它生成的代码没有任何输入参数。



下面是存储过程

  CREATE PROCEDURE`GetViewableMenuNodes`(IN网站ID INT,IN parentId的INT,用户名VARCHAR(255))
BEGIN
选择米*从menunode米

其中,m.siteid =网站ID
和m.showinmenu = 1
和m.parentid = parentId的
和m.viewername =用户名;

和这是由模型

$ B $生成的代码b

 公共全球:: System.Data.Objects.ObjectResult< MenuNode> GetViewableMenuNodes()
{
返回base.ExecuteFunction< MenuNode>(GetViewableMenuNodes);
}


解决方案

看看这个错误条目:



的http://错误。 mysql.com/bug.php?id=44985



对不起你的运气。欢迎来到俱乐部。显然,有从MySQL连接器/ .NET实体框架在MySQL存储过程适当的支持是不可用的。正如你可以从线程一直存在引入该功能一个令人难以置信的响应速度慢的日期见。


I've got the latest Mysql connector that allows you to use the Visual Studio Entity Framework designer. It's been working great, but I just added a stored proc.

The Server Explorer loaded it up fine with the parameters specified, but then I added it to the Entity Model & the code it generates doesn't have any input parameters.

Here's the stored procedure

CREATE PROCEDURE `GetViewableMenuNodes`(IN siteId INT, IN parentId INT, IN userName varchar(255))
BEGIN
    select m.*
    from menunode m 
    where m.siteid = siteId
    and m.showinmenu = 1
    and m.parentid = parentId
    and m.viewername = userName;
END

and this is the code generated by the model

public global::System.Data.Objects.ObjectResult<MenuNode> GetViewableMenuNodes()
{
    return base.ExecuteFunction<MenuNode>("GetViewableMenuNodes");
}

解决方案

Check out this bug entry:

http://bugs.mysql.com/bug.php?id=44985

Sorry about your luck. Welcome to the club. Apparently having proper support for stored procedures in MySQL from the MySQL Connector/.NET Entity Framework is not available. As you can see from the dates in the thread there has been an incredibly slow response to introduce the feature.

这篇关于使用了MySQL数据库和模型设计的实体框架不皮卡存储过程的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆