Views: 7.3K
Replies: 1
Archived
|
PRO Spark Domain/Rest Generator C# 4.5 for large database schemasI have a legacy dbase with hundreds of tables. I only need a handful of them for a current web/api project. Is it possible to select only a subset of the tables to be used by the code generators?
Matt Masteller, Sep 23, 2013
|
|
Reply 1Hello Matt:
Yes, you can do that. In both T4 files you will find the following line: var sql = @"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME NOT LIKE 'aspnet_%' AND TABLE_NAME NOT LIKE 'webpages_%'
AND TABLE_TYPE = 'BASE TABLE'
ORDER BY TABLE_NAME";
--- Since you are dealing with a legacy database, I would like to mention that the tables should adhere to the Spark data model conventions (in particular the integer Id, the audit fields are optional), otherwise it will not work. Hope this helps. Jack Poorte Jack Poorte, Sep 23, 2013
|