Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top