I have projection using EF 4.0 with self tracking entities it has one data model and everything is working fine. No I need to add a second model to to connect to a different database. As soon as I add the second model into the project the build fails. I get errors like these for all the entities in the first model.
Error 12 The type 'Entities.InvoiceFile' cannot be used as type parameter 'TEntity' in the generic type or method 'DataServices.SelfTrackingEntitiesContextExtensions.ApplyChanges<TEntity>(System.Data.Objects.ObjectSet<TEntity>, TEntity)'. There is no implicit reference conversion from 'Entities.InvoiceFile' to 'DataServices.IObjectWithChangeTracker'
Any ideas?
If I remove the POCO entities for the second model the project builds fine but then I get runtime errors like this
Test method DataServicesTest.TestStatements threw exception:
System.InvalidOperationException: Mapping and metadata information could not be found for EntityType 'Entities.Currency'.