Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SqlEntityConnection, mapping of CLR type to EDM type is ambiguous

I'm trying to rewrite a pretty simple app, from C# to F#, now using the SqlEntityConnection type provider, and I'm running into an EF issue: "the Mapping of CLR type to EDM type is ambiguous," which can occur from opening two SqlEntityConnections that each have a table with the same name.

In this case, however, it's because EF, through the type provider, is apparently mapping a system table. The actual error references the dtproperties table --

{"Schema specified is not valid. Errors: \r\nThe mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'dtproperties'. Previously found CLR type 'SqlEntityConnection2.dtproperties', newly found CLR type 'SqlEntityConnection1.dtproperties'."}

How can I change this table being mapped? Thanks.

(This isn't a problem in the original C# version, which also uses EF.)

like image 490
rachel Avatar asked Jan 06 '13 19:01

rachel


1 Answers

It is because you are using POCO and have two types with the same type name. EF ignores namespaces and therefore two types with the same name but different namespaces are ambiguous for EF. ( http://entityframework.codeplex.com/workitem/483 )

like image 168
Pawel Avatar answered Oct 09 '22 19:10

Pawel