开发者

Sitefinity 4 with LINQ to SQL?

Is it possible to have Sitefinity 4 custom mod开发者_高级运维ule with LINQ to SQL rather than openAccess? Any guidance to this?


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!


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜