Sitefinity 4 带有 LINQ to SQL?
是否可以使用具有 LINQ to SQL 而不是 openAccess 的 Sitefinity 4 自定义模块?对此有何指导?
Is it possible to have Sitefinity 4 custom module with LINQ to SQL rather than openAccess? Any guidance to this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我确信您现在已经解决了这个问题,但我目前正在使用基于 Linq-to-Sql 的模块。
如果你想创建一个与 SF 数据模型紧密链接的控件(即使用那里的表),我可能会尝试并坚持使用 OpenAccess,正如我在论坛上回答我的一个问题时被告知的那样,使用 Linq-to -sql 可能会出现问题。
因为我不想使用内置表并使用我自己的表,所以我必须调整 SDK 中的解决方案。因此,例如,如果您下载 SDK 并查看中间作业模块,您基本上必须复制它,但有一些差异:
我的模块相对简单,因此我使用 Linq-to-sql 作为我的模型,并创建一个实现我的数据提供程序基类的 Linq2SqlDataProvider。
需要注意的一些事情是,如果您正在使用视图状态,请确保在控件将驻留的页面上切换它。当我使用列表视图时,数据绑定对我来说很有趣,这意味着我必须重写 SimpleView 类的预渲染并在那里绑定,因为它在其他地方不起作用。
希望有帮助,
罗布
I am sure you have worked this out by now but i have am currently working with a Linq-to-Sql based module.
If you want to create a control that is tighly linked with the SF data model (i.e. uses there tables) i would probably try and stick to OpenAccess as i was told in a response to one of my questions on the forum that using Linq-to-sql for this could become problematic.
Becuase i didnt want to use the built in tables and use my own, i had to adjust the solutions that are in the SDK. So for instance if you download the SDK and look at the intermediete jobs module, you basically have to copy that, but with some differences:
My module was relatively simple so i used Linq-to-sql as my model and create a Linq2SqlDataProvider which implemented the my data provider base class.
Some things to look out for is if you are using viewstate, make sure you switch it on the page your control will reside. Data binding was funny for me when i was using a listview which meant i had to override prerender of the SimpleView class and bind there as it didnt work anywhere else.
Hope that helps,
Rob
Sitefinity 基于提供商模型模式 (http://www.sitefinity.com/40/help/developers-guide/deep-dive-provider-model.html)。 Sitefinity 默认情况下恰好使用 OpenAccess,但实际上您可以按照您希望的任何方式实现提供程序。例如,您可以编写一个将所有“新闻模块”数据存储在文本文件中的提供程序。
这显然适用于自定义模块,就像适用于内置模块一样。
希望这有帮助
Sitefinity is based on the provider model pattern (http://www.sitefinity.com/40/help/developers-guide/deep-dive-provider-model.html). Sitefinity just happens to use OpenAccess by default, but you can actually implement providers in any way you wish to. You could write a provider that would store all the "News module" data in text files - for example.
This works obviously for custom modules just as it does for built-in modules.
Hopes this helps
如果您根本不使用内容模型,而是意味着您已经开发了自己的后端并希望将其集成到 Sitefinity 中,我刚刚制作了一个有关在 Sitefinity 4 中开发站内模块的视频和播客: http://bit.ly/lHcOX7
与 3.x 中的 Intra-Site 模块一样,这些模块使用标准 asp用于管理和前端的.net 用户控件。该视频向您展示如何为此类模块创建简单的安装程序和卸载程序。
我希望这有帮助!
If you're not using the Content model at all, but instead you mean that you've developed your own backend and want to integrate it into Sitefinity, I've just produced a video and podcast on developing Intra-Site modules in Sitefinity 4: http://bit.ly/lHcOX7
Like Intra-Site modules in 3.x, these modules use standard asp.net user controls for the admin and frontend. This video shows you how to create a simple installer and uninstaller for such a module.
I hope this is helpful!