Please need assistance to convert this SQl Query to LINQ Query
SELECT EconCode.EconCodeId,
EconCode.EconCodeName,
EconCode.EconIncomeAmt,
EconCode.EconRecExpAmt,
EconCode.EconCapExpAmt,
FundCode.FundCodeId
FROM EconCode
LEFT OUTER JOIN FundCode
ON EconCode.FundCodeId = FundCode.FundCodeId
GROUP BY EconCode.EconCodeId,
EconCode.EconCodeName,
EconCode.EconIncomeAmt,
EconCode.EconRecExpAmt,
EconCode.EconCapExpAmt,
FundCode.FundCodeId
I have tried the following codes before but but in my report display nothing.
var query = from econ in _context.EconCode
join fund in _context.FundCode on econ.FundCodeId equals fund.FundCodeId
group new { econ, fund.FundCodeId } by new { fund.FundCodeName, econ.FundCodeId, econ.EconCodeId, econ.EconCodeName, econ.EconIncomeAmt, econ.EconRecExpAmt, econ.EconCapExpAmt } into g
select new
{
fundcodeId = g.Key.FundCodeId,
fundCodeName = g.Key.FundCodeName,
econCodeId = g.Key.EconCodeId,
econCodeName = g.Key.EconCodeName,
econIncomeAmt = g.Key.EconIncomeAmt,
econRecExpAmt = g.Key.EconRecExpAmt,
econCapExpAmt = g.Key.EconCapExpAmt,
};