umair mohsin

umair mohsin

  • 1.3k
  • 363
  • 57.6k

Show records from different tables in a single view using joins

May 5 2024 6:25 PM

  rec = (from a in context.GetModel()
                       join cCon in cContext.GetModel() on a.CanId equals cCon .CanId
                       join aCon in aContext.GetModel() on a.CanId equals aCon .CanId
                       join sCon in slContext.GetModel() on a.CanId equals sCon .CanId
                       join eCon in eContext.GetModel() on a.CanId equals eCon .CanId

                       where a.Id == id

      
                       select new Candidate  {
                           Cert = c,
                             
                            
                       });

i have joint 4 tables with candidate table.

Cert is a ICollection<Cert> field in the Candidate class 

how to show records from tables using a candidate view

of course these records from different tables are candidate Id based records

 


Answers (3)