There are two possible ways to handle this situation:
1) If your model (.RLINQ) file is used only with the ASP.NET Web API project you can override the Init method of the model class and than pass the new connection string. The code is similar to:
connectionString, BackendConfiguration backendConfiguration, MetadataContainer metadataContainer)
// Insert your logic here.
"[your conn string]"
.Init(connectionString, backendConfiguration, metadataContainer);
2) If your model (.RLINQ) is used by other projects as well maybe it is not suitable to pass new connection string in the Init method. If that is the case than the OpenAccessBaseRepository class have to be modified. First comment out the line protected TContext dataContext = new TContext();. Second add variable of your model type and in the constructor use the one that accepts connection string. The code is like the following:
//protected TContext dataContext = new TContext();
OpenAccessModel.EntitiesModel dataContext =
// Insert your logic here
Please find the attached project as an example. The changes are in classes OpenAccessBaseRepository.cs and EntitiesModel.cs.
If you encounter any difficulties implementing any of the fore-mentioned scenarios do not hesitate to contact us again.
the Telerik team