In fact you do not need to modify your context classes. All you have to do is to execute the exact same code that is provided in the documentation article on startup of your application, for example in the Application_Start method of your Global.asax.cs file. Here is the code with some more details:
Model1 context1 =
//Create a context instance. It does not matter which of the two context classes will be used here.
MetadataContainer model1 = XmlMetadataSource.FromAssemblyResource(
//Obtain the OpenAccess metadata from the first model
MetadataContainer model2 = XmlMetadataSource.FromAssemblyResource(
//Obtain the OpenAccess metadata from the second model
AggregateMetadataSource newSource =
//Merge the whole metadata
OpenAccessContextBase.ReplaceMetadata(context1, newSource.GetModel(), Callback);
//Update the internally cached metadata with the merged one, so both models work with this connection id
Afterwards you will be able to use both context classes of the two models as well as all available persistent classes.
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!