Mapping Exception : no corresponding parameter was found

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
Posts: 16
Joined: Fri 28 Nov 2008 10:11

Mapping Exception : no corresponding parameter was found

Post by nbonne » Wed 04 Mar 2009 22:07

I have a Entity framework project created with Entity Developer 2.05beta.

I can select a stored procedure from the database explorer and drag that on the design surface. The project validates and generates succesfully.

Running code against the generated class I get a mapping exception error when opening the connection on the datacontext object even before I can call the method.

using (DavinciModelEntities entities = new DavinciModelEntities())

if (entities.Connection.State != ConnectionState.Open)
entities.Getmastersdetail( ....)

System.Data.MappingException was unhandled
Message="Schema specified is not valid. Errors: \r\nModel.msl(4,6) : error 2055: Storage function has a parameter 'INMASTER_PDC' but no corresponding parameter was found in the FunctionImport.\r\nModel.msl(4,6)

Below extract of my ssdl :

csdl :

msl :

Where/how do I need to map the parameters. Should the Entity developer not generate the mappings for the parameters automatically ?

Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 05 Mar 2009 13:21

Thank you for the report, we have reproduced the problem.
It is associated with naming rules.
As a temporary workaround you can regenerate the model turning off all naming rules before adding the procedures to your model.
As an alternative workaround, rename all parameters in the CSDL part of the model in correspondence with the SSDL part using any XML Editor you like.

Post Reply