关于 SQLite ActiveRecord 模板的问题
我尝试在 SubSonic.Examples.ActiveRecord 项目中使用 SQLite,如下所示:
- 添加 System.Data.SQLite 的引用
- 将 SQLite.ttinclude 和 Settings.ttinclude 从 \T4 Templates\TemplateProviders\ 复制到 Models_Generate\
- 更改 <#@包含文件=“SQLite.ttinclude”#>在 SQLite.ttinclude 和 Settings.ttinclude
- 文件中将设置:Namespace、ConnectionStringName、DatabaseName 更改为“Blog”。
重新生成代码时遇到两个错误: 第一个是因为在SQLite.ttinclude第#80行缺少一个“break”,
case "long":
case "integer":
sysType= "long";
break; // missing a break
case "guid":
添加一个“break”后,代码文件“Context.cs”可以成功生成,但ActiveRecord.cs无法生成,有一个警告:
< strong>在模板中发现多个模板指令。除第一个之外的所有内容都将被忽略。应在一个模板指令中指定模板指令的多个参数。 D:\LP\Study\SubSonic 3 Final\Examples\SubSonic.Examples.ActiveRecord\Models_Generate\Settings.ttinclude 1 4
I try to using the SQLite in SubSonic.Examples.ActiveRecord project so:
- Add a reference for System.Data.SQLite
- Copy the SQLite.ttinclude and Settings.ttinclude from \T4 Templates\TemplateProviders\ to the Models_Generated\
- Change the <#@ include file="SQLite.ttinclude" #> in the SQLite.ttinclude and Settings.ttinclude
- Change the settings: Namespace, ConnectionStringName, DatabaseName to "Blog" in the Settings.ttinclude file.
I meet two errors when regenerate the code:
first one is because of missing a "break" at SQLite.ttinclude line #80
case "long":
case "integer":
sysType= "long";
break; // missing a break
case "guid":
After add a "break" the code file "Context.cs" can generate successfully, but the ActiveRecord.cs can not generate, there is a Warning:
Multiple template directives were found in the template. All but the first one will be ignored. Multiple parameters to the template directive should be specified within one template directive. D:\LP\Study\SubSonic 3 Final\Examples\SubSonic.Examples.ActiveRecord\Models_Generated\Settings.ttinclude 1 4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从 SubSonic 的 github 下载最新版本,一切正常!
新版本新的T4文件:Structs.tt
I download the latest version from SubSonic's github and everything is OK!
The new version a new T4 file: Structs.tt