Michael Blackburn
Michael Blackburn

Reputation: 740

"ambiguous" mapping from CLR to EDM

I understand that Code First used to have a problem (or maybe still does) when you have two classes with the same name in different namespaces. I have found numerous posts about this. I have something a little... different?

Well, however they "fixed" it, they made it worse. I don't HAVE two classes with the same name, I have ONE class. I promise you, you are not seeing double. The class name that appears below is exactly the same, and there is not other classname.

The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'Classname'. Previously found CLR type 'App.Domain.Classname', newly found CLR type 'App.Domain.Classname'.

I get this error repeated many times (for different class names) when I attempt to create a new controller with the Template "MVC controller with read/write actions and views, using Entity Framework."

Upvotes: 0

Views: 1293

Answers (1)

sabarikannan
sabarikannan

Reputation: 11

If you are having more than one edmx file in same module this problem will be occur. And even within those edmx it may have same kind of two entity was exist. This is framework issue from ef4. But it can be resolve by.changing the entity name manually.' Which was created by edmx generated. Or simple add one more dump column in any one.of the entity. In first way we should do more changes in all the entity class as well as reference entity class also.

Upvotes: 1

Related Questions