The value of EntityCommand.CommandText is not valid for a StoredProcedure command. The EntityCommand.CommandText value must be of the form ‘ContainerName.FunctionImportName’.

net_logo

January 7, 2016 | Posted in .Net

If you are seeing this exception when trying to call a stored procedure through Entityframework version 5 or greater, there is a known issue with the model tt files.

Open the tt file for your model and search for public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) and change edmFunction.Name to edmFunction.FullName.

This should fix the problem for you.

Read More →