Qus:    How can I join Three or more field using Lambda expression
Jan 26, 2021 17:55 DotNet 1 Answers Views: 1332 WALIDULHASAN BONIAMIN
isn't possible to join three or more using Lambda expression
Prev Next
Answers (1)
PARTH Jan 27, 2021 10:56
Answer:   You can refer to below example for your understanding -

var myList = Companies
.Join(
Sectors,
comp => comp.Sector_code,
sect => sect.Sector_code,
(comp, sect) => new { Company = comp, Sector = sect })
.Join(
DistributionSectorIndustry.Where(dsi => dsi.Service == "numerical"),
cs => cs.Sector.Sector_code,
dsi => dsi.Sector_code,
(cs, dsi) => new { cs.Company, cs.Sector, IndustryCode = dsi.Industry_code })
.Select(c => new {
c.Company.Equity_cusip,
c.Company.Company_name,
c.Company.Primary_exchange,
c.Company.Sector_code,
c.Sector.Description,
c.IndustryCode
});

Post Your Answer
Guest User

Not sure what solution is right for you?

Choose the right one for you.
Get the help of the experts and find a solution that best suits your needs.


Let`s Connect