EF Mapping and metadata information could not be found for EntityType Error

后端 未结 13 1676
萌比男神i
萌比男神i 2020-12-05 09:42

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

13条回答
  •  一个人的身影
    2020-12-05 10:04

    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.
    

提交回复
热议问题