I've generated an Entity Framework model from an SQL Server 2005 database and started to import stored procedures. So far so good, but one of the stored procedures throws an exception when I try to run it:
Procedure or function 'csp_getCoworker' expects parameter '@@firstname', which was not supplied.
Here is the signature for the stored procedure:
ALTER PROCEDURE [dbo].[csp_getCoworker](
@@firstname nvarchar(32),
@@lastname nvarchar(32),
@@businessarea nvarchar(512),
@@location nvarchar(512)
)
And here is the code generated by Entity Framework
ObjectParameter p_firstnameParameter;
if (p_firstname != null)
{
p_firstnameParameter = new ObjectParameter("p_firstname", p_firstname);
}
else
{
p_firstnameParameter = new ObjectParameter("p_firstname", typeof(global::System.String));
}
[...]
return base.ExecuteFunction<csp_getCoworker_Result2>("csp_getCoworker", p_firstnameParameter, p_lastnameParameter, p_businessareaParameter, p_locationParameter);
Is it the double @-characters in the parameter name that's messing things up?