This article comes from LavaBlast Software Blog After my recent post asking for the most elegant way to support multiple databases with the same schema at runtime , I received some good pointers in the SubSonic forums from dbr, a forum user. In the end, I admit should have done my homework before posting. One elegant solution to change the SubSonic Provider/ConnectionString at runtime makes use of SharedDbConnectionScope . I personally do not like this solution, as I prefer my code to explicitly state what it’s doing via its properties or arguments instead of relying on contextual information...
|
About
SubSonic is a .net open source project developed by Rob Conery and a core team of developers including Eric Kemp, Scott Watermasysk, Jon Galloway, Phil Haack, and Gavin Joyce. The current stable release is version 2.0.3. Nightly builds are available in our SVN respository. Categories
Tags
Popular
|
Entries categorized 'Customization' ↓SubSonic Limitations - Part 2 (aka: Knee deep in … SubSonic. )Thursday, April 03 2008 - Customization SubSonic LimitationsThursday, April 03 2008 - Customization This article comes from LavaBlast Software Blog Question: What is the most elegant way to reuse code generated by SubSonic for tables that share the same schema, in different databases. Ideally, I would have a shared schema definition, generated once, and seamlessly integrated into the code generated for each separate provider. Creating a separate DataProvider for a subset of tables reduces the amount of code that is generated, but is not very convenient to use if you do not use the same namespace for all your projects. Creating a separate DataProvider does not solve the problem of database selection... Webcast: Creating Your Own Code Gen TemplatesThursday, March 13 2008 - Customization This webcast shows how to alter our existing templates to generate the code you want.
I walk you through the alteration of the C-sharp class template, which is simply an ASPX page, using Visual Studio and some old-style ASP scripting skillz! Code Generation: How To Customize Our TemplatesThursday, March 13 2008 - Customization Since 1.0.4, you could override our templates (stored in the project resources) with your own implementation. All you need to do is to create one text file per template. You can find some already created for you in the Sample Web App that get's downloaded with SubSonic: Just put these in the root of your project somewhere, then pass the full reference to SubSonic in the SubSonic Config: < SubSonicService defaultProvider = " SqlDataProvider " spClassName = " SPs " templateDirectory = " C:\MySubSonicTemplates "... Now, when the code is generated it will be from your templates, not ours!... |
|
| © 2008 SubSonicProject.com. Use of this site is subject to our Terms of Use. All rights reserved. Duplication of this site, in part or in whole, is prohibited without prior written consent. |
