Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If an entity MyEntity has a property called MyProp, I cannot create an entity called MyEntity_MyProp. How do I fix that? #1979

Closed
andrerpena opened this issue Apr 2, 2015 · 1 comment

Comments

@andrerpena
Copy link

I'm using Entity Framework 6, with POCO and fluent-API and I've noticed an annoying bug.

If I have an entity called MyEntity and this entity has a property called MyProp, that makes it impossible to create an entity called MyEntity_MyProp.

Exception:

The item with identity 'MyEntity_MyProp' already exists in the metadata collection.\r\nParameter name: item

The error immediately goes away if I rename any of the entities, or rename the properties.

The "bug" is obvious: the key [EntityName]_[PropertyName] must be unique in the metadata collection.

Screenshot:

Image

I'm migrating a huge Entity Framework model with 390+ classes from EF 4, database first, to EF 6, code first, with fluent-API. It's out of question to rename the entities or the tables.

How do I solve that?

@maumar
Copy link
Contributor

maumar commented Apr 2, 2015

filed bug in codeplex instead - that's where EF6 issues should be reported:
https://entityframework.codeplex.com/workitem/2727

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants