0

I am having a issue when writing a below expression

var contactDetails = context.contacts
                            .Where(s=>s.contact_code == contactCode)
                            .Join(context.accounts, s => s.)

It will not list down the properties after "."

Any Idea? I have import the using System.Linq too.

Sumit raj
  • 821
  • 1
  • 7
  • 14
Dinesh
  • 97
  • 9

1 Answers1

0
var contactDetails =  (from con in context.contacts.Where(s=>s.contact_code == contactCode)
                      join acc in context.accounts
                      on con.Property equals acc.Property
                      select con or select acc or select new{con,acc})

select con if you only want contacts select acc if you only want accounts select new{con,acc} if you only want both

Note use only one select

Sumit raj
  • 821
  • 1
  • 7
  • 14
  • I want to do something like this without using from keyword var questionList1 = context.QuizConfiguration.Where(qc => qc.RoundId == roundId). Join(context.Question, qc => qc.QuestionId, q => q.QuestionId, (qc, q) => new { qc, q }). Join(context.Answer, q => q.q.QuestionId, ans => ans.QuestionId, (q, ans) => new { q, ans }).ToList(); – Dinesh Sep 06 '18 at 03:37
  • @Dinesh the snippet you have writtern should word...did it not? – Sumit raj Sep 06 '18 at 04:03