public List <ExpBankVoucher> GetTransactionInfoForSearch() { using (_context) { var Data = (from t in _context.EXP_BankVoucher.AsEnumerable() join b in _context.Sys_Bank on t.BankID equals b.BankID into Banks from b in Banks.DefaultIfEmpty() join br in _context.Sys_Branch on t.BranchID equals br.BranchID into Branches from br in Branches.DefaultIfEmpty() join ci in _context.EXP_CI on(t.CIID == null?null:t.CIID) equals ci.CIID into CIs from ci in CIs.DefaultIfEmpty() orderby t.BVID descending select new ExpBankVoucher { BVID = t.BVID, RefBVNo = t.RefBVNo, BVDate = (Convert.ToDateTime(t.BVDate)).ToString("dd'/'MM'/'yyyy"), BVType = (t.BVType == "DR"? "Debit": "Credit"), BankID = t.BankID, BankName = b == null?null:b.BankName, BranchID = t.BranchID, BranchName = br == null ? null : br.BranchName, ACNo = t.ACNo, ACName = t.ACName, Remarks = t.Remarks, RecordStatus = DalCommon.ReturnRecordStatus(t.RecordStatus) }).ToList(); return(Data); } }