惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - 冰戈

【解决方法】IIS 承载的服务失败 - 冰戈 - 博客园 【Silverlight】使用ChildWindow实现MessageBox 【Silverlight】利用IsolatedStorageFile实现客户端缓存 Silverlight3_Tools&SDK发布中文版 Windows Server 2008 将与 Visual Studio 2008 以及 SQL Server 2008 共同发布 基于Ajax的模糊查询输入控件(补充) 基于Ajax的编码、拼音缩写、名称模糊查询输入控件 个人站点域名改为www.oylb.net 使用PostSharp进行AOP框架设计:一个简单的原型 又一套BlogEngine主题Andreas 给博客增加了一个主题Nautica02Liquid 对BlogEngine进行了一次简单升级 SQL Server 2005公用表达式实现递归 微软2008系列 (Orcas + Longhorn Server+SQL2008)将于2008年2月27日发布 - 冰戈 使用CSS+SiteMap+UserControl+MasterPage实现简易的Tab 转实用文章:常用开源协议详细解析 抢先试用ReSharper UnitRun™ 1.0 又一款免费的VS2005单元测试插件 公司求才,你们是怎样做的?你想怎样做?
SubSonic 命令行参数及使用示例
冰戈 · 2007-06-23 · via 博客园 - 冰戈

以下是SubSonic 命令行参数

sonic.exe v2.0.1.0 - Command Line Interface to SubSonic v2.0.1.0
Usage:   sonic command [options]
Sample:  sonic generate /server localhost /db northwind /out GeneratedFiles
Help:    sonic help
TIP:    SubSonic will read your App.Config or Web.Config - just select the project and run your command.

******************** Commands *********************************
version:        Scripts out the schema/data of your db to file
scriptdata:     Scripts the data to file for your database
scriptschema:   Scripts your Database schema to file
generate:       Generates output code for tables, views, and SPs
generatetables: Generates output code for your tables
generateODS:    Generates and ObjectDataSource controller for each table
generateviews:  Generates output code for your views
generatesps:    Generates output code for your SPs
editor:         Creates an Editor for a particular table

******************** Argument List ****************************
####### Required For all commands (these can be read from config files)
if you don't have a Web or App.config, these need to be set
/override       SubCommander won't try to find a config - instead it will use what you pass in
/server -       the database server - ALWAYS REQUIRED
/db -           the database to use

####### Other Commands (some may be required for specific commands)
/userid -       the User ID for your database (blank = use SSPI)
/password -     the password for your DB (blank = use SSPI)
/out -          the output directory for generated items. (default = current)
/lang -         generated code language: cs or vb (default = cs)
/provider -     the name of the provider to use
/includeTableList -    used for generating classes. A comma-delimited list that defines which tables should be used to generate classes
/config -       the path your App/Web.Config - used to instance SubSonic
/excludeTableList    the opposite of tablelist. These tables will NOT be used to generate classes

******** Arguments Matching SubSonic web.config Settings ********
Just add a '/' in front
/generatedNamespace -  the namespace to use for generated code
/templateDirectory -   the directory containing template overrides
/fixPluralClassNames - reset all plural table names to singular? true/false
/useSPs -              whether to generate SP wrapper (true/false)
/spClassName -         default is 'StoredProcedures' - this will override that
/stripTableText -      replace table text with this command
/stripColumnText -     replace column text with this command
/stripParamText -      replace SP param text with this command
/appendWith -          when you have reserved words in your table columns we need to append it with something. Our default is 'X'.You can change that here.
/spStartsWith -        use SPs that start with this
/viewStartsWith -      use Views that start with this
/relatedTableLoadPrefix - prefix related table loaders
/removeUnderscores -   whether to remove underscores from generated object names (true/false) default is false
/templateDirectory     The path to your custom templates. This is a directory reference
/regexMatchExpression
/regexReplaceExpression
/regexIgnoreCase
/regexDictionaryReplace
/generateLazyLoads
/generateRelatedTablesAsProperties
/extractClassNameFromSPName
/includeProcedureList
/excludeProcedureList

***************************************************************

下面是一个使用的例子:

cd C:\Program Files\SubSonic\SubSonic 2.0.1

sonic generate /server localhost /db SubSonicDemo /out C:\SubsonicDemo /config "C:\Program Files\SubSonic\SubSonic 2.0.1\sonic.exe.config"

sonic scriptschema /server localhost /db SubSonicDemo /out C:\SubsonicDemo /config "C:\Program Files\SubSonic\SubSonic 2.0.1\sonic.exe.config"

这个命令将生成一系列Model和Controller类,后面那行命令是生成指定数据库SubSonicDemo 的schema。

下载生成的文件及示例工程

有个疑问:好像没有生成页面文件的命令,莫非只能用SubSonicCentral生成?知道的告知一声

***************************************************************

下面是上面用到的sonic.exe.config文件:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  
<configSections>
    
<section name="dataConfiguration"
 type
="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
"
requirePermission
="false"/>
    
<section name="SubSonicService"
type
="SubSonic.SubSonicSection, SubSonic"
allowDefinition
="MachineToApplication"
restartOnExternalChanges
="true"
requirePermission
="false"/>
  
</configSections>
  
<appSettings/>
  
<connectionStrings>
    
<add name="SubsonicDemo"
connectionString
="Data Source=localhost; Database=SubsonicDemo; Integrated Security=true;"/></connectionStrings>
  
<dataConfiguration defaultDatabase="SubsonicDemoConnection"/>
  
<SubSonicService defaultProvider="SubsonicDemo" >
    
<providers>
      
<clear/>
     
<add name="SubsonicDemo" type="SubSonic.SqlDataProvider, SubSonic"
connectionStringName
="SubsonicDemo" generatedNamespace
      
="SubsonicDemo" />
    
</providers>
  
</SubSonicService>
</configuration>