开发者

How to best integrate existing database data in a content type

I have an existing database (SQL) with relational data (for example with various 1-n and m-n relationships) that I would like to integrate into a Orchard CMS based website. That database has a ASP.NET Dynamic Data as the backend data maintenance application.

What I would like to do is integrate this information into Orchard, i.e. use Orchard CMS to surface the information to the users. Furthermore, I would like to take advantage of Orchard's concept to extend a content type with further functionality (example tagging, comments).

But: I struggle with finding the best way to integrate that data without creating a complicated maintenance process (creating a content part where one would have to specify the Id of the item in my existing database).

Unfortunately, I did not find any 开发者_运维技巧sample for what I would like to achieve... Any suggestions?


If you have an existing, complex database, moving it to Orchard storage system completely would be a very painful process...

The best option would be to keep the existing data in the current database, the Orchard content in second one and wire them together (feed the content part with appropriate data from your primary db) on a content part handler level.

I wrote a short walkthrough about how to achieve that in an answer for other, very similar SO question - here.

After all, if you want to store everything in one place, you can always write your own IRepository<> implementation to store content parts, but it's a lot of work, and I'd advise you to avoid that unless you really have to.

HTH

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜