tags:

views:

59

answers:

1

Hi,

I am using Fluent NHibernate,

I have writen following code to select Customer Name and CustProdId.

when i execute code, i got error, "Method Join is not implimented."

How to write inner join for this query?

var data = (from cp in session.Linq<CustomerProduct>()                        
                     join cu in session.Linq<Customer>()
                         on cp.customerId equals cu.customerID                        
                     select new
                     {
                         cp.CUSTPRODID,
                        cu.CUSTOMERNAME
                     }).Distinct();
+1  A: 

This is a limitation of the Linq to NHibernate implementation that ships with Fluent NHibernate, not FNH directly.

Basically, you're out of luck using linq for complex queries until the rewrite is complete in NHibernate trunk. You should fall back on the Criteria API or HQL.

James Gregory
thanks........................
Rahul Somwanshi