LINQ QUERY

Topics: Customizing Orchard, Writing modules
Dec 1, 2011 at 7:16 PM

Will this Linq query work in the Orchard/NHibernate world?:

db.Pryor_Topics
        join pryor_prditmmst in db.Pryor_PrdItmmst on new { TopicCode = pryor_topics.TopicCode } equals new { TopicCode = pryor_prditmmst.ItemNumber }
        where
          pryor_topics.TopicCode == "ABD01101AC"
        select new {
          pryor_topics.TopicCode,
          pryor_topics.BrochureDesc,
          pryor_topics.URL,
          pryor_topics.ControlPrice,
          pryor_topics.City,
          pryor_prditmmst.Description

My worry is that I've never seen (db.tablename)
 used in any Orchard module Linq queries.
I am using a repository for my Table object. should I replace db. with _tablenameRepository.TableName?

Thanks
Oceantrain


Coordinator
Dec 9, 2011 at 3:07 AM

Joins will be a problem with Linq to nHib. You should try plain SQL or HQL.