PsychoCoder
PsychoCoder

Reputation: 10765

Member Mapping Error, MVC 2 and EF4

I created my own entity to go with the stored procedure I wrote. The mappings for said SP and Entity seemed to go fine, now I'm getting this error (out pf the blue too)

Error 7 Error 2019: Member Mapping specified is not valid. The type 'Edm.Decimal[Nullable=True,DefaultValue=,Precision=19,Scale=4]' of member 'ItemPrice' in type 'GodsCreationTaxidermyModel.StoreItem' is not compatible with 'SqlServer.varchar[Nullable=True,DefaultValue=,MaxLength=15,Unicode=False,FixedLength=False]' of member 'ItemPrice' in type 'GodsCreationTaxidermyModel.Store.StoreItems'. F:\Projects\GodsCreationTaxidermy\GodsCreationTaxidermy.Data\GCTModel.edmx 1071 17 GodsCreationTaxidermy.Data

Got any ideas what could be causing this?

Upvotes: 0

Views: 1414

Answers (1)

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364389

The exception says that your conceptual model (entity) has ItemPrice defined as decimal but your storage model (database description or stored procedure) returns it as VARCHAR(15). EDMX consists of several layers and these layers don't correspond in for ItemPrice. Something is wrong in your mapping.

Upvotes: 1

Related Questions