EdmRelationshipAttribute Error in Entity Framework

I get the following error when I try to assign a new reference to a navigation property. So far, all my searches have actually not shown anything useful, so I was wondering if I could get help from this.

Metadata information for relationship 'CustomerModel.FK_Execution_ClientBlock' could not be obtained. Verify that the EdmRelationshipAttribute attribute for the relationship has been defined in the Node

It is strange that all my code works. This only happens during the unit test. I guess this is because I use the mock structure (MOQ) to mock this particular EF object.

We use the version of EF that comes with .net 3.5 if that helps.

+3
source share
1 answer

I had a similar problem earlier, in my case the solution was as follows: MetadataException when using Entity Framework Entity Connection

Basically you need to add the DLL name to the metadata connection string

+1
source

Source: https://habr.com/ru/post/1778340/


All Articles