The mapping of CLR type to EDM type is ambiguous with EF 6 & 5?

后端 未结 14 1606
长发绾君心
长发绾君心 2020-11-27 05:38

Please any one can help me to fix this error?

Schema specified is not valid. Errors:

The mapping of CLR type to EDM type is ambiguous because mult

14条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 06:29

    Workaround: Change a property on one of the two identical classes.

    EF matches on class name AND class properties. So I just changed a property name on one of the EF objects, and the error is gone.

    As @Entrodus commented on one of the other answers:

    EF collision happens only when two classes have the same name AND the same set of parameters.

提交回复
热议问题