First of all we have to make sure that both of your model, as I understand in different projects and mapped by different rlinq files, are enhanced. Please open both project containing rlinq files and check if the following line exists in them (you have to open with a text editor the csproj/vbproj files) :
If it is not available, please add it somewhere near the end of the file. In these targets there is one running the enhancer after each compilation, which is a necessary step for OpenAccess to work.
If that is not the problem the problem might be if both context instances are using the same connection string. You see internally a context instance works with a static Database
object that holds the mapping information needed. The problem is that for each connection string name only one Database
object is stored. And if two different context instances are using the same connection string they both will use the Database
object that is created first. Which means that one of your models mapping information will not be available and this exception might occur.
In order to work around this issue you can either make sure that the database object created with this connection string name holds the information for both model (which would mean manually instantiating one) or make sure that both context classes use different connection strings (they can be the same however the names of the connection strings have to be different).
I hope this proves to be helpful, please do let us know if you want to merge the mapping information and create the database instance by yourself so that we can provide information on how to do that exactly.
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Public Issue Tracking
system and vote to affect the priority of the items