from t in _policyPrintingNoteRepository.GetAll()
join p in _planRepository.GetAll() on new { t.PlanCode, t.ProductId }
equals new { PlanCode = p.Code, p.ProductId } into planView from p in planView.DefaultIfEmpty()
join pr in _productRepository.GetAll() on t.ProductId
equals pr.Id into productView from pr in productView.DefaultIfEmpty()
orderby t.Id descending
select
new
{
t.Id,
t.StartDate,
t.EndDate,
t.ProductId,
ProductName = pr.Id + " " + pr.Name,
t.PlanCode,
PlanName = t.PlanCode + " " + p.Name,
t.ProposalStatus,
t.NoteTypeCode,
};