If i have 3 tables. How can i use IEnumerable LINQ Joins to join all 3 tables together? here is my current query and I want to join another IEnumerable called BudgetTargets using the GPRow id = Budgettargets id
var rows = _context.GpRows.Join(
_context.ShopInfos,
GpRow => GpRow.ShopId,
ShopInfo => ShopInfo.ShopId,
(GpRow, ShopInfo) => new{
ShopName = ShopInfo.ShopName,
State = ShopInfo.State,
YearMonth = String.Concat(GpRow.Year, GpRow.Month),
GpRow.Year,
GpRow.Month,
GpRow.Id,
GpRow.ShopId,
GpRow.PaintSale,
GpRow.PanelSale,
GpRow.PartsSale,
GpRow.OtherSale,
GpRow.PaintCost,
GpRow.PanelCost,
GpRow.PartsCost,
GpRow.OtherCost,
GpRow.PanelWages,
GpRow.PaintWages,
GpRow.Depreciation,
GpRow.ForecastedSales,
GpRow.Expenses
}
)
.Where(GpRow => shopId_Array.Contains(GpRow.ShopId))
.OrderByDescending(a => a.Year).OrderByDescending(b => b.Month).ThenBy(c => c.State).ThenBy(c => c.ShopName)
.ToList();