亚音速ActiveRecord
我正在尝试让 Subsonic(3.0.0.4) 工作(.Net 3.5 - VS2010),简单的安装使用 ActiveRecord 查看 Northwind 数据库。我使用了 http://subsonicproject.com/docs/The_5_Minute_Demo 中的 5 分钟演示。我添加了对 dll 的引用,解锁了下载的 T4 模板,更改了 Settings.ttinclude 以根据视频在 3 个位置指向 Northwind 数据库。将 T4 模板(根据视频)拖到 VS2010 中的“模型”文件夹中。
如果我编译,我会继续收到“找不到类型或名称空间名称‘某物’”有 13 个错误(与数据库中表的数量相同..),所以我猜测一定有一些命令可以改变每张桌子都分成一个类,但是在哪里呢?我右键单击 ActiveRecord.tt 和 Context.tt 并选择“运行自定义工具”,但没有成功。
任何帮助,我严格按照这个演示进行操作,但仍然收到错误。有什么帮助吗?
I am trying to get Subsonic(3.0.0.4) to work(.Net 3.5 - VS2010), simple install that looks at the Northwind database using ActiveRecord. I used the 5 minute demo from http://subsonicproject.com/docs/The_5_Minute_Demo. I added the reference to the dll, un-blocked the T4 templates that I downloaded, changed the Settings.ttinclude to point to the northwind database in 3 places as per video. Dragged the T4 templates (as per video) to my Models folder in VS2010.
If I compile I keep on getting "Type or namespace name 'something' could not be found" There are 13 error (same amount as the amount of tables in the DB..) so I am guessing that there must be some command that turns every table into a class, but where? I right-clicked on ActiveRecord.tt and Context.tt and selected "Run custom tool" with no success.
Any help, I follow this demo to the letter and still get the error. Any help.. please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我不知道为什么,但在我添加 Structs.tt 后,它编译得很好。我仍然无法让视图中的 foreach 工作,错误是: foreach 语句无法对“object”类型的变量进行操作,因为“object”不包含“GetEnumerator”的公共定义
我可以从Rob的视频说它没有继承自System.Web.Mvc.ViewPage,想通了应该是System.Web.Mvc.ViewPage>
有时聪明人(比如罗布)无法为适当的傻瓜(比如我)思考,这就是生活吗?
Ok, I do not know why but after I added Structs.tt it compiled fine. I still could not get the foreach in the view to work, the error was: foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public definition for 'GetEnumerator'
I could see out of the corner of Rob's video that it did not inherit from System.Web.Mvc.ViewPage and figured out that it should be System.Web.Mvc.ViewPage>
Sometimes clever people(Like Rob) cannot think for proper dummies(like me) Such is life?