trying to execute the stored proc in EF using the following code:
var params = new object[] {new SqlParameter("@FirstName", "Bob")};
return this._repositoryContext.ObjectContext.ExecuteStoreQuery<ResultType>("GetByName", params);
but keep getting this error:
Procedure or function ‘GetByName’ expects parameter ‘@FirstName’,
which was not supplied.
and from sql profiler:
exec sp_executesql N'GetByName',N'@FirstName nvarchar(100),@FirstName=N'Bob'
what is wrong wit the above ExecuteStoreQuery code?
Ignoring the fact that
paramsis a reserved word…Think your query needs to be:
Should also say that if that proc is a standard part of your database and data model then you should import it into your EDM so it’s available directly on your context.