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.
In case you find this helpful, here is the approach I use for working with stored procedures with parameters in MySQL from the MySQL Connector/.NET Entity Framework provider. I call ExecuteStoreQuery(). This liberates me from having to deal with the challenges of mapping procedures with parameters in the model. This works for our needs.
public IList SearchMembers(int memberID, string countryCode, string regionCode, string cityCode, float distanceKm,
int genderID, int ageMin, int ageMax, int offsetRowIndex, int maxRows)
{
MySqlParameter[] queryParams = new MySqlParameter[] {
new MySqlParameter("memberIDParam", memberID),
new MySqlParameter("countryCodeParam", countryCode),
new MySqlParameter("regionCodeParam", regionCode),
new MySqlParameter("cityCodeParam", cityCode),
new MySqlParameter("distanceKmParam", distanceKm),
new MySqlParameter("genderIDParam", genderID),
new MySqlParameter("ageMinParam", ageMin),
new MySqlParameter("ageMaxParam", ageMax),
new MySqlParameter("offsetRowIndexParam", offsetRowIndex),
new MySqlParameter("maxRowsParam", maxRows)
};
StringBuilder sb = new StringBuilder();
sb.Append("CALL search_members(@memberIDParam, @countryCodeParam, @regionCodeParam, @cityCodeParam, @distanceKmParam, @genderIDParam, @ageMinParam, @ageMaxParam, @offsetRowIndexParam, @maxRowsParam)");
string commandText = sb.ToString();
var results = _context.ExecuteStoreQuery(commandText, queryParams);
return results.ToList();
}