I am using EF 4.3 Code first with MySQL database. I am having problem executing stored procedure on the server. The code looks like as follows:
ExecuteFunction<SomeResultType>("StoredProcName",parameter1)
I am getting error The FunctionImport ‘StoredProcName’ could not be found in the container ‘CodeFirstContainer’.
I have tried giving name as CodeFirstContainer.StoredProcName but no luck. Anyone have any idea about this problem?
Thanks,
Have you imported the stored procedure to your EDMX and created function import for it?
ExecuteFunctionis dependent on EDMX and function imports. If you are using code-first you cannot use it. You must useExecuteStoreQuery/ExecuteStoreCommandonObjectContextinstance orSqlQuery/ExecuteSqlCommandon Database instance accessible throughDbContextinstance.