How to get child table data in mvc using linq lamdaexpression
hi all i have a table PO_AMS AND ITS CHILD TABLE IS PANORDER_RSPTRK so i want to bring processed date from PANORDER_RSPTRKbelow i have written code where iam wrong plz suggest me or solve if any
var pOMS =
db.POAMS.Where(po => po.BuyerId == pAN_USER.Userid)
.Where(po => po.Status == id)
.Where((po => po.Latest == 1 || po.Latest == 9))
.Include(p => p.PAN_APPROVERGROUP)
.Include(p => p.PAN_USER)
.Include(p => p.PAN_USER1)
.Include(p => p.PAN_USER2)
.Include(p => p.PAN_UPLOAD)
.Include(p => p.PAN_ORDRSP_TRK);
and below if have written linq not working
if (recResDate != null)
{
if (recResDate != "")
{
DateTime rDate = DateTime.ParseExact(recResDate, eProAppConstants.ddMMyyyy, System.Globalization.CultureInfo.InvariantCulture);
if (!rDate.Equals(DateTime.MinValue))
{
// pO_AMS = pO_AMS.Where(poams => DbFunctions.TruncateTime(poams.PAN_ORDRSP_TRK) == DbFunctions.TruncateTime(rDate));
pO_AMS = pO_AMS.Where(poams => DbFunctions.TruncateTime(PAN_ORDRSP_TRK.ProcessedDate) == DbFunctions.TruncateTime(rDate));
}
}