This thread gives a number of ways to provide a parameter to a stored procedure.
None of them are working for me.
This works:
this.PayrollContext.Database.SqlQuery<CSRRateEntity>("ord_getCSRRate @csr_num = '4745', @ord_pay_period_id = 784").ToList();
This does not:
return this.PayrollContext.Database.SqlQuery<CSRRateEntity>("Exec ord_getCSRRate @csr_num, @ord_pay_period_id",
new SqlParameter("csr_num", "4745"),
new SqlParameter("ord_pay_period_id", 784)
).ToList();
The Error message is that parameter is not supplied.
Have tried all the variations I can think of and still get that same error message.
This is using Code First, so no import is required. The SP is found, it is just missing the parameters.