Sitefinity 4 带有 LINQ to SQL?

发布于 2024-10-31 18:40:07 字数 71 浏览 5 评论 0原文

是否可以使用具有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

痴者 2024-11-07 18:40:08

我确信您现在已经解决了这个问题,但我目前正在使用基于 Linq-to-Sql 的模块。

如果你想创建一个与 SF 数据模型紧密链接的控件(即使用那里的表),我可能会尝试并坚持使用 OpenAccess,正如我在论坛上回答我的一个问题时被告知的那样,使用 Linq-to -sql 可能会出现问题。

因为我不想使用内置表并使用我自己的表,所以我必须调整 SDK 中的解决方案。因此,例如,如果您下载 SDK 并查看中间作业模块,您基本上必须复制它,但有一些差异:

  1. 我的数据提供程序基类实现了 DataProviderBase 而不是 ContentDataProviderBase >
  2. 我的 Manager 类实现了 ManagerBase 而不是 ContentManagerBase
  3. 我的 Module 类实现了 ModuleBase 而不是 ContentModuleBase
  4. 我认为配置部分是与我的配置步骤相同

我的模块相对简单,因此我使用 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:

  1. My Data Provider Base Class implemented DataProviderBase not ContentDataProviderBase
  2. My Manager class implemented ManagerBase not ContentManagerBase
  3. My Module class implemented ModuleBase not ContentModuleBase
  4. The config section i think was the same just with my configuration steps

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

好多鱼好多余 2024-11-07 18:40:08

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

身边 2024-11-07 18:40:07

如果您根本不使用内容模型,而是意味着您已经开发了自己的后端并希望将其集成到 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文