Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Error: No overload for method 'Join' takes 4 arguments
 

Pages: 1
LLBLGen Pro Runtime Framework
Error: No overload for method 'Join' takes 4 arguments
Page:1/1 

  Print all messages in this thread  
Poster Message
Bashir
User



Location:

Joined on:
30-Oct-2018 16:34:44
Posted:
4 posts
# Posted on: 30-Oct-2018 16:46:41.  
Hi there,

I just wanted to join two tables with more than one condition in Linq. But I got the following error message: "No overload for method 'Join' takes 4 arguments".

I have searched a lot on the internet and your website, but I could not find any information.

Related Code:
Code:


LinqMetaData db = new LinqMetaData();
var result = from s in db.Survey
                 join r in db.Review on new { s.SurveyId, s.ContactId }
                                        equals new { r.SurveyId, r.ContactId }
                         select new { s, r };



Thanks for your time.
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14449 posts
# Posted on: 30-Oct-2018 17:52:34.  
Example:

Code:
var q = from c in mData.Customer
        join o in mData.Order on new { ID = c.CustomerId, Country = c.Country } equals new { ID = o.CustomerId, Country = o.ShipCountry }
        select c;


Hint: Use the same Property Names at both sides (ID & Country in my example).


  Top
Bashir
User



Location:

Joined on:
30-Oct-2018 16:34:44
Posted:
4 posts
# Posted on: 31-Oct-2018 10:29:59.  
Walaa wrote:
Example:

Code:
var q = from c in mData.Customer
        join o in mData.Order on new { ID = c.CustomerId, Country = c.Country } equals new { ID = o.CustomerId, Country = o.ShipCountry }
        select c;


Hint: Use the same Property Names at both sides (ID & Country in my example).



Hi Walaa,
Many thanks for your fast reply. I have used your hint, but still, I get the error message. To update you, we are using LLBLGen ver 4.2 right now. Do you think it is relevant to the error message?
  Top
Bashir
User



Location:

Joined on:
30-Oct-2018 16:34:44
Posted:
4 posts
# Posted on: 31-Oct-2018 10:48:37.  
Code:

            LinqMetaData db = new LinqMetaData();
            var result = from sy in db.Survey
                         join sctemp in db.SurveyContactGroup on sy.Id equals sctemp.SurveyId into sysctemp
                         from sc in sysctemp.DefaultIfEmpty()
                         join cgtemp in db.ContactGroupRelation on sc.ContactGroupId equals cgtemp.ContactGroupId into sccgtemp
                         from cg in sccgtemp.DefaultIfEmpty()
                         join rvtemp in db.Review on new { sid = sc.SurveyId, cid = cg.ContactId } equals new { sid = rvtemp.SurveyId, cid = rvtemp.CreatedByContactId } into sccgrytemp
                         from rv in sccgrytemp.DefaultIfEmpty()
                         select rv;



Hi Walaa,
This is my latest changes and now I get another error message:

"The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'GroupJoin'."

Many thanks.



  Top
Bashir
User



Location:

Joined on:
30-Oct-2018 16:34:44
Posted:
4 posts
# Posted on: 31-Oct-2018 11:00:58.  
Hi Walaa,
I have found the problem.

It was related to the type mismatch of properties! Laugh Sorry if I take your time.
Code:

LinqMetaData db = new LinqMetaData();
            var result = from sy in db.Survey
                         join sctemp in db.SurveyContactGroup on sy.Id equals sctemp.SurveyId into sysctemp
                         from sc in sysctemp.DefaultIfEmpty()
                         join cgtemp in db.ContactGroupRelation on sc.ContactGroupId equals cgtemp.ContactGroupId into sccgtemp
                         from cg in sccgtemp.DefaultIfEmpty()
                         join rvtemp in db.Review on new { sid = sc.SurveyId, cid = cg.ContactId } equals new { sid =[b](long)[/b] rvtemp.SurveyId, cid = rvtemp.CreatedByContactId } into sccgrytemp
                         from rv in sccgrytemp.DefaultIfEmpty()
                         select rv;




new { sid =(long) rvtemp.SurveyId, cid = rvtemp.CreatedByContactId }

  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.