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
how to show records from tables using a candidate view
of course these records from different tables are candidate Id based records
Jayraj ChhayaPosted May 6, 2024, 7:47 AM
Hi,
To display records from multiple tables in a single view using joins in a .NET application, you can utilize LINQ queries to join the tables and retrieve the desired data. In the provided code snippet, the user has already performed joins on four tables with the Candidate table based on the Candidate Id.
To show records from these tables using a Candidate view, you can modify the LINQ query to include the fields from the joined tables in the select statement. For example, if you want to display the Cert field from the ICollection in the Candidate class, you can include it in the select statement like this:
Jignesh KumarPosted May 6, 2024, 3:29 AM
Hello Umair,
Please refer,
Prasad RaveendranPosted May 6, 2024, 3:06 AM
try this