I have encountered an exception when I use Entity Framework 4.0 RC. My Entity Framework model is encapsulated in a private assembly who\'s name is Procurement.EFDataProvider
I was getting this error because I had more than edmx file in the same assembly with out proper use of custom namespaces.
Here is what is said about the exception in System.Data.Objects.ObjectContext
// Exceptions:
// System.InvalidOperationException:
// When the System.Data.Metadata.Edm.EntitySet from entitySetName
// does not match the System.Data.Metadata.Edm.EntitySet of the object’s
// System.Data.EntityKey.
// -or-
// When the System.Data.Objects.ObjectContext.DefaultContainerName
// property is not set on the System.Data.Objects.ObjectContext and
// the name is not qualified as part of the entitySetName parameter.
// -or-
// When the specified type belongs to more than one entity set.