3

I have an Error creatting relations whith EntityFramework 4.0

The changes to the database were committed successfully, but an error occurred while updating the object context. The ObjectContext might be in an inconsistent state. Inner exception message: Metadata information for the relationship 'CodeFirstNamespace.EventsIndex_Module' could not be retrieved. If mapping attributes are used, make sure that the EdmRelationshipAttribute for the relationship has been defined in the assembly. When using convention-based mapping, metadata information for relationships between detached entities cannot be determined. Parameter name: relationshipName

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user674790
  • 31
  • 1
  • 3

1 Answers1

1

There's probably a property in your entity class that's missing.

Patrik Svensson
  • 13,536
  • 8
  • 56
  • 77
  • The problem is when added a foreing key to a class( the class module is in a project and EventIndex in another) – user674790 Mar 24 '11 at 14:18
  • 1
    same problem here! any solution?http://stackoverflow.com/questions/17502470/errora-referential-integrity-constraint-violation-occurred-on-db-savechanges – SHEKHAR SHETE Jul 06 '13 at 11:32