C# EF6使用参数调用存储过程

C# EF6使用参数调用存储过程,c#,mysql,entity-framework-6,edmx,C#,Mysql,Entity Framework 6,Edmx,我在MySQL中有一个存储过程,它接受一个整数并返回多个结果集。 据我所知,我认为这是一种方法 var cmd = context.Database.Connection.CreateCommand(); cmd.CommandText = "CALL `GetBlogPosts`(@BlogId)"; cmd.Parameters.Add(new MySqlParameter { ParameterName = "BlogId", Value = 1 }); 但是我得到了这个错误: The

我在MySQL中有一个存储过程,它接受一个整数并返回多个结果集。
据我所知,我认为这是一种方法

var cmd = context.Database.Connection.CreateCommand();
cmd.CommandText = "CALL `GetBlogPosts`(@BlogId)";
cmd.Parameters.Add(new MySqlParameter { ParameterName = "BlogId", Value = 1 });
但是我得到了这个错误:

The specified cast from a materialized 'System.String' type to the 'System.Int32' type is not valid.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1})' at line 1
如果我将命令更改为此

cmd.CommandText = "CALL `GetBlogPosts`({@BlogId})";
我得到这个错误:

The specified cast from a materialized 'System.String' type to the 'System.Int32' type is not valid.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1})' at line 1

什么是
GetBlogPosts
及其定义?为什么在第二个示例中需要
{
}
?那么
GetBlogPosts
只接受一个int类型的输入参数,并返回多个结果集。定义重要吗?我在某个地方读过
{}
的用法,也尝试过,但没有成功。