EB.
EB.

Reputation: 2757

Orchard CMS, how to Query the Orchard Database?

I need to Query existing Tables inside my Orchard database. These tables are coming from an existing ecommerce website. So my question is: How do I query tables that contain data inside my Orchard database and have the data displayed on the Admin/Editor side. And finally on the front end/user side when the page is published? I have All the Models, Drivers, Handlers and Views created. I'm just stumped on where to Query the DB.

Upvotes: 0

Views: 2600

Answers (1)

Bertrand Le Roy
Bertrand Le Roy

Reputation: 17814

You can inject an IRepository and do queries on its Table. If that is still too high level, you can inject an ISessionLocator and call For on it. The session object it will give you is the nHibernate session, on which you can perform arbitrary queries.

Upvotes: 2

Related Questions