We have a fairly large database and thus a fairly large mappings xml block, and we want to store the <mappings> section outside of our web.config and reference this mappings file.
If you only want to store the class mappings (and not the connection settings, etc.) outside the web.config I guess the easiest way to do it is to create a class library holding your persistent classes and have an app.config in that class library to contain the mappings for the classes.
You can then reference the class library from your web app or another class library. I think it is good practice to do so.. in terms of separation of concerns..
While what Henrik suggested is true, you can also just use a custom xml file with the contents. I have prepared a sample project that does exactly this. Basically I have instructed OpenAccess to use this file by modifying the ConfigFile project extension of the project, you can find it if you select the project in the solution explorer and click F4, this will pop up the property pane if it is not already visible.
Also I have made this new config file an embedded resource and during runtime in the AdjustForDynamicLoad method I am passing the information to the Database.Get method.
I should also point out that you are using the old wizards approach and if you were to give our new designer a try you will find out that the model information is by default kept in a separate file, an rlinq file.
I hope this proves to be helpful and please do let us know if you face further trouble.
All the best,
Serge
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!